UnixDroid

Network · Linux command

ssh command in Linux

What does ssh do?

ssh opens an encrypted remote terminal on another machine. It is how admins manage Linux servers.

ssh [options] user@host

Most useful options

OptionWhat it does
-p 2222use another port
-i keylog in with a private key
-L 8080:host:80local port forwarding (tunnel)

ssh examples

$ ssh student@server.example.com Try it ›

log in

$ ssh -i ~/.ssh/id_ed25519 admin@server Try it ›

log in with a key

$ ssh-keygen -t ed25519 Try it ›

create a key pair

In security work

Disable password logins and PermitRootLogin, use keys — otherwise brute-force bots will find you within minutes.

Questions about ssh

What is the default SSH port?

22.