0

I have a user named lap that was set up during install of a service named lap. I have to be logged in as user lap to execute certain functions and to access some directories. I do not have the root password. I tried:

$ su - lap
Password: "MyPassWord"
su: Authentication failure

In this case the password I tried is the password of the current user I was logged in as. Which is the same password I would supply for sudo. Also i tried:

$ sudo su - lap
Sorry, user xxxxxgrp is not allowed to execute '/bin/su - lap' as root on myServerName.

In /etc/passwd

lap:x:1003:1004::/opt/lap:/bin/csh

In /etc/shadow

lap:!!:17674:0:99999:7:::

Is there a way I can change to user lap?

  • sudo -i -u lap – jw013 Jun 18 '18 at 17:33
0

Only a privileged user (mainly root) can do that or elsewhere can grant you permissions to run things as 'lap' user without password using 'sudo' for specific tasks.

0

The easiest way to get in as root using sudo would be:

sudo - su

entering your sudo password to log in as root. (By the way, most distros don't assign a default root password on setup).

Once you are in as root, it is as easy as assigning a password to lap by doing:

passwd lap

which should allow you to create a new password for that user regardless of what the old one might have been.

However, if you don't have access to an account with sudo privileges, you can always boot into the machine in single-user mode. The method of booting in with single-user mode will vary depending on which distribution you are currently running.

This should take you directly to a root shell where you can then change the password for lap as described above, allowing you full access to that account.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.