ssh

Connect to a remote server

What it does

ssh user@host opens a terminal on a remote machine: everything you type next runs there. Leave with exit or Ctrl+D. If SSH on the server listens on a non-standard port, give it with -p.

A key is better than a password: ssh-keygen -t ed25519 creates a key pair, and ssh-copy-id user@host puts the public one on the server. Describe frequent connections in ~/.ssh/config, and ssh web-01 is enough.

Syntax

ssh <user>@<host>
ssh -p <port> <user>@<host>
ssh-copy-id <user>@<host>

Examples

Related commands

Practise · All commands