• Important: We recently upgraded our forum software - please let us know if you run into any issues.

AutoSSH

I'm using autoSSH to connect to an Amazon ec2 server. I need to automatically reconnect to the server if the SSH connection is lost for a few seconds.

I need the system to know that it has lost the SSH connection and then re-establish the connection to the server.
In some cases, the Ethernet connection will remain established. Only the SSH session will get "broken". Is thee a way that I can get the system to reconnect after a short fault?

I'm using a Raspberry pi and I can get the connection reestablished by rebooting the Raspberry, but otherwise it won't reconnect.
 


Rob

Administrator
Staff member
I haven't messed around with autossh in a while - let me take a look at some config options, etc.. i'd imagine it should see that it has a broken connection.

Have you also looked into sshfs? Allows you to mount a remote filesystem using ssh.. would that give you the constant connection to your ec2 instance that you're looking for as well?
 
I haven't messed around with autossh in a while - let me take a look at some config options, etc.. i'd imagine it should see that it has a broken connection.

Have you also looked into sshfs? Allows you to mount a remote filesystem using ssh.. would that give you the constant connection to your ec2 instance that you're looking for as well?

I'm have a reverse tunnel set up in the Amazon server so that I can get live serial data over the net. I don't think I could use a remote filesystem for that.
 

tchakatak

Member
Hello Charles,

I would use either something like mmonit, puppet or another monitoring/mgmt tool, and look for a specific access/file each second.

If the resource is not accessible, then restart the program
 
  • Like
Reactions: Rob

Members online



Top