2

I am executing a BASH shell script (downloadScript.sh) on a remote server in the below way. Since the script takes more time to execute, the remote shell is getting timed out in between.

ssh -i aws.pem username@remoteserver "./downloadScript.sh"

Please let me know how can make sure that the remote shell alive till the script execution.

Error message I am receiving:

packet_write_wait: Connection to <remoteserver> port 22: Broken pipe

Note: I don't want to modify any configuration on remote server.

How can I add ServerAliveInterval and ServerAliveCountMax to the ssh -i aws.pem username@remoteserver "./downloadScript.sh" command..!?

Greenonline
  • 1,851
  • 7
  • 17
  • 23
Rohith
  • 123

1 Answers1

1

As per your comment to Vlastimil, You can use -o parameter in your ssh command. Example could be

ssh -o ServerAliveInterval=60 -i aws.pem username@remoteserver "./downloadScript.sh"
Nitesh B.
  • 563