LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to login as user who has no password (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-login-as-user-who-has-no-password-83918/)

danahata 08-20-2003 03:03 PM

how to login as user who has no password
 
I created a user called 'pcguest' (for samba), and when prompted for a password, I just hit enter. Now, I tried to login as that user using 'su - pcguest', and when prompted for the password, I just hit enter, and I get the incorrect password message. Anyone know how (or if) I can log in with this user?

Dana

kev82 08-20-2003 03:24 PM

if you dont want the user to have a password you need to edit the users entry in /etc/passwd, as root edit /etc/passwd, find the row with his name in, it should look something like this

kev82:x:100:100::/home/kev82:/bin/bash

you are interested in the second field, it might not say x, depends if you have shadow passwords enabled or not, but if this field is empty you will not be prompted for a password for this user, so change it to

kev82::100:100::/home/kev82:/bin/bash

obviously the names and numbers will be different on your system

you can find out all about this file by typing 'man 5 passwd' at a command prompt.

lfur 08-20-2003 05:41 PM

Quote:

if you dont want the user to have a password you need to edit the users entry in /etc/passwd
... and /etc/shadow ... if you are using it.

kev82 08-20-2003 05:49 PM

Quote:

... and /etc/shadow ... if you are using it.
you dont actually, if the second field in /etc/passwd is blank it logs you in regardless of the contents of /etc/shadow

lfur 08-20-2003 05:57 PM

It skips the shadow file ??? Didn't know that one.


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