Help with login problem!

Rick Stevens rstevens at vitalstream.com
Thu Apr 28 18:02:47 UTC 2005


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                          -
----------------------------------------------------------------------




More information about the Redhat-install-list mailing list