You are not logged in.

#1 2015-12-24 03:31:44

jbodhorn
Member
Registered: 2015-12-11
Posts: 130

ssh can't ssh back in after I exiting a previous session

When I boot my server I can ssh into it just fine. If I exit the session and try to log back in later, it sometimes hangs after I enter my password.When it hangs I cant ctrl +c to cancel either, I have to kill the process. Once it does this sometimes the only way for me to regain ssh access is to reboot the server, other times I can kill the process, try again and gain access. The server is running arch, it's just a small family minecraft server, but this ssh thing is going to cause some issues if I'm accessing it from outside my home, at least if I'm home I can go and reboot, but if I'm out and ssh isn't letting me in its not an option to reboot. What can I do to remedy this problem?

I've been fighting with this all day, and of course the problem being intermittent, now that I try to give some debug info it doesn't hang... next time it does it I'll post that info. Until then, can anyone thing of a reason for this to happen? It's a lot less intermittent since I copied over the sshd_config from my raspberry pi, but it still randomly happens. My guess is that it has something to do with the sshd_config but I have no idea which option(s) would cause it. This has never happened to me when using ssh to access my pi, that's why I decided to use that config, I figured the problem would go away by switching...

Offline

#2 2015-12-24 05:30:16

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: ssh can't ssh back in after I exiting a previous session

Did you do some special setup on your RPi's SSH server configuration or why did you overwrite the default sshd_config with it?

What's the output of the server-side journal the moment you log in and it blocks? Try to log in once (and hope it works), then run `journalctl -f`, then try to trigger that "block" by connecting to the server through a server second terminal as you described.

Also, I assume that you are not able to simply ^C the SSH connection because you seem to be connected and authenticated, and it seems to be the server-side process that is not responding. In that case you will need to use the SSH client's escape characters to interact with it (i.e. ~. to disconnect); see section "Escape Characters" in the ssh (1) man page.

Last edited by ayekat (2015-12-24 05:55:51)


pkgs │ hacks │ cfg │ blag

Offline

#3 2015-12-24 20:54:21

jbodhorn
Member
Registered: 2015-12-11
Posts: 130

Re: ssh can't ssh back in after I exiting a previous session

ayekat wrote:

Did you do some special setup on your RPi's SSH server configuration or why did you overwrite the default sshd_config with it?

What's the output of the server-side journal the moment you log in and it blocks? Try to log in once (and hope it works), then run `journalctl -f`, then try to trigger that "block" by connecting to the server through a server second terminal as you described.

Also, I assume that you are not able to simply ^C the SSH connection because you seem to be connected and authenticated, and it seems to be the server-side process that is not responding. In that case you will need to use the SSH client's escape characters to interact with it (i.e. ~. to disconnect); see section "Escape Characters" in the ssh (1) man page.

I definitely didn't do anything special in my RPi's sshd server setup, I just figured if I used that config and the problem went away then it was for sure a config problem. Of course since I got fed up with the issue and posted asking for help it hasn't happened since. It's just weird because most of the ssh problems I saw while googling were due to firewall which most definitely shouldn't be the problem, I haven't messed with IP tables or anything.

It started happening after an update and in that update was sshgenkey, there were other updates in that bunch but I think that's the only one that would have made a difference in my ssh. I've been adding -vvv to my ssh login since I decided I needed to debug because it was still happening with the RPi config that I know has no problems. There's a lot more options in the config that comes with arch, a bunch of stuff I had never used or knew were options to add to the config. There's a reason I'm posting in the newbie section, my linux knowledge is quite limited...

I hate to say I'm thankful for this but it just happened again, here's a pastebin of the output http://pastebin.com/Ftvdu5Cj

I killed the process client side and successfully connected immediately after here's that pastebin http://pastebin.com/kXk735XA

Last edited by jbodhorn (2015-12-24 20:58:40)

Offline

#4 2015-12-25 11:56:03

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: ssh can't ssh back in after I exiting a previous session

Could you still try to see what the systemd journal is telling you on the server-side for a "stuck" login?


pkgs │ hacks │ cfg │ blag

Offline

Board footer

Powered by FluxBB