Commands.app

ssh

Networking

Secure Shell - connect to remote machines securely

Options & Flags
Available options for this command
-p port

Specify port number (default is 22)

-i keyfile

Use specific private key file

-L port:host:hostport

Local port forwarding

Examples
Common usage examples

Connect to remote host

ssh user@hostname

Connect to remote host on specific port

ssh -p 2222 user@hostname

Connect using specific SSH key

ssh -i ~/.ssh/private_key user@hostname
Notes
  • First connection will prompt to verify host fingerprint
  • Use ssh-keygen to generate SSH key pairs
  • Config file: ~/.ssh/config for saving connection settings
Related Commands
You might also find these useful