Add a host to SSH config

Short alias: "ssh dev" applies all these 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

  • ~.

    Press Enter, then type ~ and . to close a hung session

  • ssh-keyscan -t ed25519,rsa host 2>/dev/null | ssh-keygen -lf -

    Get the server host keys and show their fingerprints without logging in

  • echo 'from="10.0.0.0/8",no-agent-forwarding,no-port-forwarding,command="/usr/bin/backup.sh" <pubkey>' >> ~/.ssh/authorized_keys

    Allow the key only from 10.0.0.0/8, block forwarding and force one command

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

    Set the private key file explicitly

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

    Reach an internal host through one bastion host with ProxyJump

all 15 ssh commands