Difference between revisions of "Autossh"

From wikieduonline
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 24: Line 24:
 
* [[alias]]: <code>[[.bash_aliases]]</code>
 
* [[alias]]: <code>[[.bash_aliases]]</code>
 
* [[sshpass]]
 
* [[sshpass]]
* [[assh]]
+
* [[ssha function]]
  
 
== See also ==
 
== See also ==
Line 30: Line 30:
 
* {{netcat}}
 
* {{netcat}}
 
* {{ssh clients}}
 
* {{ssh clients}}
 +
* {{ssh}}
  
 
[[Category:Security]]
 
[[Category:Security]]

Latest revision as of 10:38, 24 July 2026

man monitor and restart ssh sessions

Installation

autossh -M 0 YOUR_SERVER


Loop waiting to connect to server[edit]

AUTOSSH_POLL=30 AUTOSSH_GATETIME=0 autossh -M 0 test
AUTOSSH_POLL=5 AUTOSSH_GATETIME=0 autossh -M 0 -o ServerAliveInterval=5 -o ServerAliveCountMax=1 YOUR_SERVER_NAME_OR_IP

Function: .bash_aliases[edit]

function ssh_auto() {
    AUTOSSH_POLL=30 AUTOSSH_GATETIME=0 autossh -M 0 "$1"
}
alias sa='ssh_auto'

Related[edit]

See also[edit]

Advertising: