Jump to content

Ubuntu Ssh Problem


Insight

Recommended Posts

Got a bit of a problem with accessing my home laptop using SSH (using PuTTY in Windows if this info helps). The machine runs fine for a usually few days, then hangs after the "login as:" prompt. A few hours later SSH refuses to respond at all, even when connecting when Telnet.

I've got a few TCP/IP tunnels set up when I connect to access various proxy servers and to Remote Desktop into my Windows machine.

Anybody seen this before? Although it usually occurs when the machine has been up for a few days, this morning it happened after 3 hours.

The laptop is a few years old so maybe it's starting to overheat...?

Link to comment
Share on other sites

Obvious question to ask, since it's a laptop, is to ensure it's not set to hibernate.

The ideal would be if you had somebody (reasonably technically literate) on the phone next to the laptop that could troubleshoot. It's possible that a dead connection hasn't freed the socket or similar.

(Alternatively, some sort of logging every hour - just to show statuses - i.e. active connections and the like... - If there no log, you know the system either crashed or hibernated. If there is a log at a time when you couldn't connect, that should say if the port is still busy, then possibly checking what's wrong, and either changing settings to drop inactive connections, or, worst case, writing a little script to monitor for it, and kill and restart the processes as necessary.)

Link to comment
Share on other sites

Linux is very verbose, so it should help looking through the log files.

Run sshd in verbose mode (-d), or more verbose (-d -d) or even more verbose (-d -d -d). See `man sshd`.

You could also monitor the connection (wireskark etc) but I don't think it is useful at that point, since you will probably find in the SSH log what's wrong.

If needed, try to remotely reboot your laptop. I use port knocking for that (see `knockd`).

Link to comment
Share on other sites

Thanks for all the advice folks. The machine is now closing the SSH socket immediately after opening it now, so looks like I need to reboot it somehow.

Problem is I'm not going to be in front of the machine for at least another week - it's in Thailand and I'm in the UK. It's also behind a firewall/router with only the SSH port forwarded. Will look up port knocking to try reboot, but if there's any other methods available...?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.




×
×
  • Create New...