About ssh command generator
SSH logs you in to a remote machine securely. The builder assembles the command with port, key file, jump host and port forwarding.
Useful options
- -i points to a private key and -p sets the port.
- -J connects through a jump (bastion) host.
- -L forwards a local port to a remote service.
Config file
Save frequent hosts in ~/.ssh/config, so you can type ssh myserver.
A worked example
ssh -i ~/.ssh/id_ed25519 -p 2222 [email protected] connects on port 2222 with a specific key. Adding -L 5433:localhost:5432 forwards your local port 5433 to the server's database port, so a local tool can use it securely. -J bastion.example.com connects through a jump host.
Making it easier
- Add a Host block to ~/.ssh/config with the host name, user and key.
- Use ssh-agent so you type the key passphrase once.
- Disable password logins on servers and use keys only.
