Tuesday, May 8, 2012

How to keep your SSH session alive (Linux, Mac)

Your ssh session is automatically disconnected after the idle time, if you want to keep the connection alive, do as follow:
1. Open terminal
2. Edit ssh_config
sudo nano /etc/ssh/ssh_config
3. Add the following line to the end of the file

          ServerAliveInterval 5

4. Ctrl+X and enter y to save the files
5. You are done!
You can change 5 to any number, here 5 is the number of seconds for the clients to sends a small keep-alive packet to the server so that the connection is not disconnected.

Hope this help!

rsync with delete option and different ssh port

How to rsync e.g PIPELINE dir from Source to Destination? #rsync -avzr   --delete-before  -e "ssh -p $portNumber"  /local...