<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
FS wrote:
<blockquote cite="midddac487905042811141cc52988@mail.gmail.com"
 type="cite">
  <pre wrap="">On 4/28/05, Rick Stevens <a class="moz-txt-link-rfc2396E" href="mailto:rstevens@vitalstream.com"><rstevens@vitalstream.com></a> wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">FS wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">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!
      </pre>
    </blockquote>
    <pre wrap="">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.

    </pre>
    <blockquote type="cite">
      <pre wrap="">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
      </pre>
    </blockquote>
    <pre wrap="">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     <a class="moz-txt-link-abbreviated" href="mailto:rstevens@vitalstream.com">rstevens@vitalstream.com</a> -
- VitalStream, Inc.                       <a class="moz-txt-link-freetext" href="http://www.vitalstream.com">http://www.vitalstream.com</a> -
-                                                                    -
-  Animal testing is futile.  They always get nervous and give the   -
-                             wrong answers                          -
----------------------------------------------------------------------
    </pre>
  </blockquote>
  <pre wrap=""><!---->
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@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@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@c7504s98 /home$

Thanks,
Faisal

  </pre>
</blockquote>
It seems that permissions are OK. Howevwr there may be problem with a
user shell - ssh and su do need working user shell (FTP does not). What
is the shell for that user as shown in /etc/passwd? That value should
point to a shell program (such as bash or sh) accessible and executable
by that user. It is also possible that you have a problem with PAM
configuration for su and ssh.<br>
<br>
Alexey Fadyushin<br>
Brainbench MVP for Linux.<br>
<a class="moz-txt-link-freetext" href="http://www.brainbench.com">http://www.brainbench.com</a><br>
<br>
<br>
</body>
</html>