You are not logged in.
I have a machine with a few users and an ssh server.
I would like to setup a user with rbash or nologin for the shell but if i do that, I can't ssh onto that user.
my /etc/passwd
zidar:x:1000:100:zidar:/home/zidar:/bin/bash
smotko:x:1001:1001::/home/smotko:/bin/rbashnow
ssh zidar@pc
su smotko #this works
# but this doesnt
ssh smotko@pc # works only if i change the passwd file back to /bin/bashthis is with my log for ssh with rbash
Dec 25 03:17:25 arch-dev sshd[636]: Failed password for smotko from 10.0.2.2 port 49075 ssh2
and same with bash
Dec 25 03:20:18 arch-dev sshd[678]: Accepted password for smotko from 10.0.2.2 port 49088 ssh2
and this is how ssh looks with anything other than /bin/bash in /etc/passwd
$ ssh smotko
smotko@pc's password:
Permission denied, please try again.
password is correct because i can use it locally
thank you for helping
Last edited by zidarsk8 (2014-03-14 14:59:17)
Offline
Are these shells listed in the /etc/shells file? I think openssh reads that and will only allow logins for shells that are listed there.
Offline
It is easier to log in to those users, then use the chsh command to change their shell. chsh automatically presents the "valid" shells on your system.
Offline
The Arch bash package doesn't actually have the /usr/bin/rbash command. So not only is this not included in the /etc/shells file, but you are also trying to set the shell to something that doesn't actually exist. See the RESTRICTED SHELL section of the bash man page.
I think wat you are after might be achieveable by simply using 'set' in the given user's startup files.
Offline
thanks guys. In ubuntu you don't have to edit anything, and I didn't know about the /etc/shells, but putting rbash and false there seems to do the trick.
Offline