ssh commands
15 commands, each with a one-line explanation. Click a command to copy it, or its title for details.
Commands 15 shown
-
ssh -i ~/.ssh/id_ed25519 user@hostSpecify an identity file explicitly
-
ssh -J bastion.example.com user@internal-hostSingle-hop jump through bastion host
-
ssh -J user@bastion1,user@bastion2 user@targetChain multiple jump hosts in one command
-
ssh -L 5432:db.internal:5432 user@bastion -NForward localhost:5432 to db.internal:5432 via bastion
-
ssh -R 8080:localhost:3000 user@vps -NExpose local port 3000 as port 8080 on VPS
-
ssh -D 1080 user@vps -N -fCreate a local SOCKS5 proxy tunnelled through VPS
-
ssh -o ControlMaster=auto -o ControlPath=~/.ssh/mux-%r@%h:%p -o ControlPersist=10m user@hostReuse existing connection for subsequent SSH commands
-
ssh user@host 'sudo systemctl status nginx'Execute a command over SSH without interactive shell
-
scp -r -P 2222 ./dist/ user@host:/var/www/app/Recursive copy on non-standard port
-
ssh -A user@bastionForward local SSH agent to the remote host (use with caution)
-
eval $(ssh-agent) && ssh-add ~/.ssh/id_ed25519Start agent and load a key for the session
-
cat >> ~/.ssh/config <<'EOF' Host dev HostName 10.0.0.5 User ubuntu IdentityFile ~/.ssh/dev_key ProxyJump bastion EOFShorthand alias: 'ssh dev' triggers all options
-
~.Terminate a frozen/hung SSH session: type tilde then dot
-
ssh-keyscan -t ed25519,rsa host 2>/dev/null | ssh-keygen -lf -Fetch and fingerprint server host keys without connecting
-
echo 'from="10.0.0.0/8",no-agent-forwarding,no-port-forwarding,command="/usr/bin/backup.sh" <pubkey>' >> ~/.ssh/authorized_keysForce-command and restrict source IP in authorized_keys
no commands match — try a different search