views:

423

answers:

2

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.

A: 

When a user logs on, the shell takes them to their user directory and possibly runs a "startup" script.

  1. Is the user directory on the local machine? Does it have to be mounted from a fileshare (this has happened to me on more than one occasion)? If that fileshare is not mounted you will get disconnected.
  2. Take a look at the startup scripts for those shells. Bash uses various startup scripts depending on the circumstance, these include /etc/profile and ~/.bashrc. These scripts sometimes do wacky things that may disconnect you for any number of reasons.
Daniel Gill
A: 

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 to ssh with the verbose option activated ( ssh -v user@host ) so you can get more detail.

-Check the /etc/hosts 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 o /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 check syslog, messages and user), so maybe you can get any meaningful message...

Sorry about my English, and let us know more data if you have it...

Andor