I’m trying to help someone with their Debian server.
They have Plesk. I made myself an user with Plesk and enabled SSH access.
I can log on … but only for one second. I see the MOTD, I see a Debian disclaimer, then I’m logged out again. “Connection closed”.
The only thing I could think to try is to change the shell settings, Plesk has a dropdown list of bash, csh, tcsh and so on next to the “allow ssh using:” option. But none of them works.
Any ideas gratefully received.
3
Answers
When a user logs on, the shell takes them to their user directory and possibly runs a “startup” script.
Plesk can get a bit quirky sometimes…
That behavior is similar to the one you get when a user account has a ‘nologin’ shell selected on the Plesk config. I would do some things:
Connect using ssh with the verbose option activated (
ssh -v user@host
) so you can get more detail.Check the /etc/passwd file, look for your user and check that, the final field on that line, is pointing to a valid shell (something like
/bin/bash
instead of/bin/nologin
or/bin/false
).Check also in that line that the home directory for that user ( that’s configured on the field before of the shell ), is valid, exists, and has proper permissions and owner
Finally, check your logs (in
/var/log
; I think I would checksyslog
,messages
anduser
), so maybe you can get any meaningful message.The way I fixed this problem is, unfortunately, to manually change the last parameter in
/etc/passwd
for users I want to give shell access. It is/bin/bash
instead of/bin/false
.