LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Using "su" failes (https://www.linuxquestions.org/questions/linux-newbie-8/using-su-failes-730469/)

johnnyxxxcakes 06-03-2009 01:41 PM

Using "su" failes
 
I keep getting an authentication failure when I enter:

Quote:

john@john-laptop:~$ su
Password:
su: Authentication failure
john@john-laptop:~$
I entered the password for myself (the user john), but that gives me the authentication failure. I don't ever remember setting a root password so I wouldn't know what to enter here. Is there a way to set a new one?

Uncle_Theodore 06-03-2009 01:44 PM

Quote:

Originally Posted by johnnyxxxcakes (Post 3561957)
I keep getting an authentication failure when I enter:
I entered the password for myself (the user john), but that gives me the authentication failure. I don't ever remember setting a root password so I wouldn't know what to enter here. Is there a way to set a new one?

No, when using su, you should give the root password. Otherwise, use sudo if it's configured.

To set a new root passwd, boot in single user mode and type
passwd

Single user mode is accessible at boot, how exactly you do this depends on your bootloader (grub or lilo). Generally, you get to the boot prompt and type
linux single

or
linux 1

Disillusionist 06-03-2009 02:39 PM

With some disributions you don't create a root password during the installation (for example Ubuntu) and therefore the root account is disabled for logins until a password is set.

In these instances, you normally have sudo configured for the initial user out of the box.

If this is the case, you could run (as the initial user):
Code:

sudo passwd
Enter your password to enable sudo, then when prompted enter what you want the root password to be.

soleilarw 06-04-2009 08:30 AM

What is the practical purpose to use 'su' to gain access to the very same account that you are already using (user 'john' trying to su to user 'john')?

Linux Archive

druuna 06-04-2009 08:34 AM

@soleilarw: That is not the case.

su -> become root but keep the environment settings of the user that is su-ing.
su - -> become root and use root's environment.

There's a difference, but in the end both will switch to user root.


All times are GMT -5. The time now is 07:05 PM.