SSH config file host entry

Shorthand alias: 'ssh dev' triggers all options

cat >> ~/.ssh/config <<'EOF' Host dev HostName 10.0.0.5 User ubuntu IdentityFile ~/.ssh/dev_key ProxyJump bastion EOF

tool
ssh15 commands
tags
ssh

More ssh commands

  • ~.

    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_keys

    Force-command and restrict source IP in authorized_keys

  • ssh -i ~/.ssh/id_ed25519 user@host

    Specify an identity file explicitly

  • ssh -J bastion.example.com user@internal-host

    Single-hop jump through bastion host

all 15 ssh commands