ssh closes connection immediately after login [closed] ssh closes connection immediately after login [closed] hadoop hadoop

ssh closes connection immediately after login [closed]


The fact that you can log in but then disconnect makes me think that it's something after login. If the issue were your key, it should fall back on PasswordAuthentication (unless disabled at the server).

The behavior you're seeing is what I'd expect if your default shell were set to /bin/false, or if the sshd_config on the server was doing something extra like chrooting your login.

Next steps:

  1. Review the server log & sshd_config, if possible.
  2. Verify that your login shell is correctly listed in /etc/passwd.
  3. Audit your .profile or other login shell startup script.
  4. Check your authorized_keys file to ensure you don't have something at the beginning of the public key that could be interpreted as a (bad) forced command.