Difference between revisions of "Autossh"
Jump to navigation
Jump to search
Function:
Tags: Mobile web edit, Mobile edit |
|||
| (32 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
| − | apt install autossh | + | {{lc}} [https://linux.die.net/man/1/autossh man] monitor and restart ssh sessions |
| − | + | * Homepage: https://www.harding.motd.ca/autossh/ | |
| + | |||
| + | Installation | ||
| + | * <code>apt install autossh</code> | ||
| + | * <code>[[brew install autossh]]</code> | ||
| + | |||
| + | [[autossh -M]] 0 YOUR_SERVER | ||
| + | |||
| + | |||
| + | == Loop waiting to connect to server == | ||
| + | [[AUTOSSH_POLL]]=30 AUTOSSH_GATETIME=0 [[autossh -M]] 0 test | ||
| + | |||
| + | <code>AUTOSSH_POLL=5 AUTOSSH_GATETIME=0 [[autossh -M]] 0 -o [[ServerAliveInterval]]=5 -o ServerAliveCountMax=1 YOUR_SERVER_NAME_OR_IP</code> | ||
| + | |||
| + | == Function: <code>[[.bash_aliases]]</code> == | ||
| + | function ssh_auto() { | ||
| + | AUTOSSH_POLL=30 AUTOSSH_GATETIME=0 autossh -M 0 "$1" | ||
| + | } | ||
| + | alias sa='ssh_auto' | ||
| + | |||
| + | == Related == | ||
| + | * <code>[[.bash_profile]]</code> | ||
| + | * [[alias]]: <code>[[.bash_aliases]]</code> | ||
| + | * [[sshpass]] | ||
| + | * [[ssha function]] | ||
== See also == | == See also == | ||
| + | * {{Autossh}} | ||
* {{netcat}} | * {{netcat}} | ||
| + | * {{ssh clients}} | ||
* {{ssh}} | * {{ssh}} | ||
| − | |||
[[Category:Security]] | [[Category:Security]] | ||
Latest revision as of 10:38, 24 July 2026
man monitor and restart ssh sessions
- Homepage: https://www.harding.motd.ca/autossh/
Installation
apt install autosshbrew install autossh
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]
- Autossh, autossh -M, ssha function
telnet,netcat, nc, nc -l,ncat,socat, ngrok- SSH clients:
ssh (OpenSSH),putty, MobaXterm,plink,mosh,paramiko,conchpssh,sshpassandautossh,sftp, Termius - SSH:
ssh, TLS,.ppk, .pem, .crt, .pub, ED25519, Key exchange method (KEX), public key, private key,ssh -Q kex,IAMUserSSHKeys,known_hosts, ssh tunnel, Dropbear,ssh -o,~/.ssh/config
Advertising: