[solved] Ssh immediate logout after interactive login

Not sure, when this started, but I wanted to login as root to my turris router yesterday, and got logged out immediately after a successful (as shown bei ssh -vvv) ssh login.
I can log in to luci and foris, I also can run commands via ssh, but there is no chance to log in interactively.

Any idea? TIA!.


For me the question is not understandable … what is interactive login ?

That’s surely the “normal” mode without specifying a command to run. man ssh:

If a command is specified, it is executed on the remote host instead of a login shell.

1 Like

Exactly. Just running “ssh root@myrouter”.

does ssh -vvv root@myrouter give any useful logging output?

As far as I understand, -vvv shows, that I got logged in without any problem - and immediately logged out.

Solved. Was my own mistake. I had an “exit 0” somewhere in a script called by my profile.

1 Like

sshd allows 6 methods how user can be authed. Interactive means user is prompted for username and password. That is basic and default option. Usually admin use it once to generate public-key and switch to pubkeyauth method and disable the interactive(password auth method). Aside publickey you can have also host-key auth method (so not only pubkey is used, but additionally user host is checked. There is also “Challenge” (two factor, otp…stuff) and GSSAPI methods. And there is also “keyboard” auth method, where you get some prompt and you have to answer some question to be authed (never used that so far :slight_smile:
You can tell sshd which methods can be used. You can have more methods enabled and sshd will try them in case user is not authed on first try.

1 Like

Yes… but it’s something else than was meant above :slight_smile: (interactive shell)

my bad :slight_smile: , sorry :slight_smile: