Help with login problem!

FS bastiji at gmail.com
Thu Apr 28 18:14:05 UTC 2005


On 4/28/05, Rick Stevens <rstevens at vitalstream.com> wrote:
> FS wrote:
> > Hello all,
> >
> > I set up a new FC1 machine yesterday and created a user "newuser"
> > using "adduser newuser" and changed its password.
> >
> > When I try to ssh to the said account, it doesn't work. The connection
> > opens, accepts my password and then closes instantly. Trying to "su -
> > newuser" or "su newuser" result in a "could not open session"
> > Interestingly enough, FTP does work!
> 
> Uh, yeah.  Tell me, did you use the "-m" option to adduser?  If not,
> then the new user doesn't have a home directory unless you created one
> for him separately and used the "-d" option to adduser to specify what
> it was.  And if you did that, don't forget you must change the ownership
> and group for the user's home directory to the new user's UID and GID or
> it won't work properly.
> 
> If you did it properly:
> 
>        # adduser -m newuser
> 
> If you have to do it separately:
> 
>        # adduser newuser
>        # cat /etc/passwd | grep newuser
>        # mkdir /home/newuser
>        # chown newuser:newusergroup /home/newuser
> 
> The "cat" command dumps the /etc/passwd entry for the new user so you
> can get the user's home directory and group.  You use that data in the
> last two commands.
> 
> > Googling seems to point to permissions problem but I can't figure out
> > where or what. The /etc/passwd is 644, /etc/group is 644 and
> > /etc/shadow is 600
> 
> It's referring to the user's home directory, not the permissions on
> passwd or group.
> 
> Remember, FTP doesn't have an issue if the user's home directory doesn't
> exist because there's no shell involved with FTP.  ssh IS a shell and
> as such, REQUIRES a home directory with valid permissions.
> ----------------------------------------------------------------------
> - Rick Stevens, Senior Systems Engineer     rstevens at vitalstream.com -
> - VitalStream, Inc.                       http://www.vitalstream.com -
> -                                                                    -
> -  Animal testing is futile.  They always get nervous and give the   -
> -                             wrong answers                          -
> ----------------------------------------------------------------------

Rick -- Thanks for responding.

You're right. I did not use the -m option, but when I checked, the
adduser process had somehow created the home directory automatically
and gave it proper permissions.

Please take a look below. Should these be something else?

root at c7504s98 /home$ ls -al
total 16
drwxr-xr-x    4 root     root         4096 Apr 28 12:44 .
drwxr-xr-x   19 root     root         4096 Apr 27 15:29 ..
drwx------    2 newuser newuser  4096 Apr 28 13:20 newuser
root at c7504s98 /home$ ls -al newuser
total 28
drwx------    2 newuser newuser     4096 Apr 28 13:20 .
drwxr-xr-x    4 root     root         4096 Apr 28 12:44 ..
-rw-------    1 newuser  newuser        21 Apr 28 13:21 .bash_history
-rwxr--r--    1 newuser  newuser        24 Apr 28 12:44 .bash_logout
-rwxr--r--    1 newuser  newuser       191 Apr 28 12:44 .bash_profile
-rwxr--r--    1 newuser  newuser       281 Apr 28 12:44 .bashrc
-rwxr--r--    1 newuser  newuser       120 Apr 28 12:44 .gtkrc
root at c7504s98 /home$

Thanks,
Faisal




More information about the Redhat-install-list mailing list