Troubleshooting

Why does the connection close right after I sign in?

Fix an SSH session that closes right after sign-in in Wardterm: the shell of the account, a startup command or a device that allows one channel only.

What you see

The login works, then the terminal shows Connection closed or Connection lost within a few seconds.

Why it happens

  • The account has no shell, such as /usr/sbin/nologin, or the server runs one fixed command and closes.
  • A command in the startup files of the shell, such as exit in .bashrc, ends the session.
  • The startup command saved in the server's settings ends the session.
  • Some routers, switches and firewalls accept only one channel per connection.

What to do

  1. Check the shell of the account on the server:
    getent passwd deploy
    The last field is the shell. It must be a real shell such as /bin/bash.
  2. Open the server and choose Show more. Under At startup, set Startup command to None.
  3. For a router, switch or firewall, open the server, choose Show more, then Connection, turn off Automatic commands and connect again.
  4. On a server you manage, allow more sessions per connection in /etc/ssh/sshd_config, then restart SSH:
    MaxSessions 10

With OpenSSH you can see where the session ends:

ssh -v deploy@203.0.113.10