ssh
NetworkFundamentals In real LinuxLog in to a remote machine securely
Name: ssh = Secure Shell
This command needs a real Linux system; you can practise it in real Linux mode.
Description
ssh logs into remote machines and runs commands over an encrypted connection, replacing telnet's plaintext passwords. Passwords work, keys (made with ssh-keygen) are better.
Settings for frequent hosts go in ~/.ssh/config so a short name connects. ssh also does port forwarding and jump hosts.
Syntax
ssh [OPTION]... [USER@]HOST [COMMAND]Common options
| -p PORT | Port (default 22) |
| -i KEYFILE | Identity (private key) file |
| -J JUMPHOST | Go through a jump host, e.g. -J user@bastion |
| -L PORT:HOST:PORT | Local port forwarding |
| -R PORT:HOST:PORT | Remote forwarding: a port on the remote machine reaches HOST:PORT from here |
| -D PORT | A local SOCKS proxy that goes out through the remote machine |
| -N | Run no command; only forward ports |
| -f | Go to the background after logging in (usually with -N) |
| -t | Force a terminal (for remote top, sudo and the like) |
| -o OPTION | Set a configuration option, e.g. -o StrictHostKeyChecking=no |
| -C | Compress the data (helps on slow links) |
| -v | Verbose, for debugging |