• We did not send an email asking for donations - please read this post.

charles linquist

New Member
Joined
Oct 27, 2018
Messages
11
Reaction score
1
Credits
0
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
Joined
Oct 27, 2011
Messages
925
Reaction score
1,776
Credits
1,201
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?
 
OP
C

charles linquist

New Member
Joined
Oct 27, 2018
Messages
11
Reaction score
1
Credits
0
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
Joined
Nov 14, 2018
Messages
34
Reaction score
36
Credits
0
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
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online


Top