ssh (OpenSSH client)
Jump to navigation
Jump to search
↑ https://serverfault.com/a/132973
↑ https://stackoverflow.com/a/48330113
ssh (man) is the OpenSSH ssh client for logging or executing commands into remote devices/machines
ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
[-E log_file] [-e escape_char] [-F configfile] [-I pkcs11] [-i identity_file] [-J destination] [-L address]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] [-Q query_option] [-R address] [-S ctl_path]
[-W host:port] [-w local_tun[:remote_tun]] destination [command]
-X Enables X11 forwarding-N Do not execute a remote command. This is usefull for just forwarding portsssh -vvvssh -Vssh -tssh -Ossh -o ConnectTimeout=100ssh -issh -Lssh -R
Windows: Settings > Apps and click “Manage optional features” under Apps & features.
Contents
Configuration[edit]
- Configuration file:
~/.ssh/config ~/.ssh/environment
Usage[edit]
ssh remote_User@server_Name_Or_IPssh [email protected] -p 1111 -i ./yourprivkeyssh -vvv REMOTE_USERNAME@REMOTE_SERVER_NAME_OR_IP(-vincrease verbosity, maximum 3)ssh -vvv REMOTE_USERNAME@REMOTE_SERVER_NAME_OR_IP 2>&1 | grep "STRING_TO_SEARCH"
Execute a remote command:
ssh USERNAME@SERVER_NAME '/path/to/remote/scripts/backup.sh'
ssh -Q kex SERVER
Example commands[edit]
ssh -o StrictHostKeyChecking=accept-new [email protected](since OpenSSH 7.5, March 2017)ssh -o StrictHostKeyChecking=no [email protected][1]ssh -Q kex SERVERssh -o MACs=hmac-sha2-256 HOSTNAME
Multiplexing options[edit]
ssh -O check server.example.org or ssh -O check [email protected] Master running (pid=26289)
ssh -O check [email protected] Control socket connect(/path/): No such file or directory
To stop an specific multiplexed session:
Avoid using Multiplexing for a connections:
ssh -o "ControlMaster=no" server.example.org
See also: Configure OpenSSH to reuse ssh connections
Logs[edit]
ssh -i id_ed25519_xxxxx.pub SERVER_NAME Load key "id_ed25519_xxxxx.pub": invalid format Solution: Use private key instead of public key [2] ssh -i id_ed25519_xxxxx SERVER_NAME
Activities[edit]
- Understand differences between stop and exit:
ssh -O exit [email protected] - Configure OpenSSH to reuse ssh connections
- Execute a command in parallel by ssh
ssh -o PreferredAuthentications=keyboard-interactive -o PubkeyAuthentication=no host1.example.org- Reverse SSH tunneling
Configuration[edit]
Related[edit]
See also[edit]
- OpenSSH:
ssh(man),ssh -O,-i, -t,-T, -N, -L, -V,/etc/ssh/ssh_config,ssh --help - SSH clients:
ssh (OpenSSH),putty, MobaXterm,plink,mosh,paramiko,conchpssh,sshpassandautossh,sftp, Termius
Advertising: