SSH (Secure Shell) is a network protocol for secure communications between two devices. SSH is a standard utility on Linux distributions and BSD, typically OpenSSH.
- Browse and remotely execute commands on another device, i.e. a server or a micro-computer such as a Raspberry Pi.
- Transfer files between devices securely using the
- Use another device as a personal proxy using a technique called SSH tunneling.
To connect to an SSH server run
ssh email@example.com. If user is not specified, the name of the local logged-in user will be used in place. You may be asked to enter a password.
To setup SSH on a server make sure the
sshd daemon is running. If using systemd run
systemctl enable sshd --now. Check the local article on doing so securely.
Generating an SSH key-pair
Instead of using a password to login to remote systems, you should use a key pair which is more secure.
It works by generating a public and a private key, optionally protected by a strong passphrase. The public keep is then placed on the remote system and the private key is stored somewhere safe, where unauthorized people can't access it. When the client tries to establish a connection it uses the private key to sign a message which the server then verifies against the public key.
You can generate a keypair using the
ssh-keygen utility. The key should be saved under the
~/.ssh directory (note: this location is not XDG compliant).
Then copy the generated public key to the server using the
ssh-copy-id -i ~/.ssh/mykey.pub user@host