OpenSSH will not terminate a shell session that has been idle for some time. This is not something that OpenSSH does. Terminating an idle shell session is unrelated to the configuration of OpenSSH.
The settings that you are showing are related to timeouts when the connection goes down and are unrelated to the shell on the remote host and what the user is doing or not doing there.
The remote host’s shell may terminate (or may get killed by some other process) after some time of idleness, but this is unrelated to the configuration of the SSH service on the server and of your SSH client.
1 2 3 4 5
# ~/.bash_profile or /etc/profile ## set a 5 min timeout policy for bash shell TMOUT=300 readonly TMOUT export TMOUT
local port: client port(application client, no ssh client)
remote port: server port(application server, no ssh server )
-f Requests ssh to go to background just before command execution. This is useful if ssh is going to ask for passwords or passphrases, but the user wants it in the background.
-N Do not execute a remote command. This is useful for just forwarding ports.
The -a option is a combination flag. It stands for “archive” and syncs recursively and preserves symbolic links, special and device files, modification times, group, owner, and permissions. It is more commonly used than -r and is usually what you want to use.
1 2 3 4 5
# pull the latest copy of remote server and only updates will be transferred. > rsync -alpPtzv --progress --delete --exclude=.git "user@hostname:/remote/source/code/path" . # To push content, reverse the source and target parameters in the command. > rsync -alpPtzv --progress --delete --exclude=.git . "user@hostname:/remote/source/code/path"