ssh

SSH, and

Syntax

ssh [options] [user@]hostname [command]

Parameters

ParametersDescriptionExamplesLevel
-p --port ssh -p 2222 user@host Common
-i ssh -i ~/.ssh/id_rsa user@host Common
-v ssh -v user@host Advanced
-o ssh -o StrictHostKeyChecking=no user@host Advanced
-q , and ssh -q user@host Advanced
-N command() ssh -N -L 8080:localhost:80 user@host Advanced

Examples

ssh user@192.168.1.100
22

ssh -p 2222 deploy@production.example.com
SSH 2222

ssh -i ~/.ssh/work_key root@10.0.0.1

command

ssh user@host 'ls -la /var/log'
command

Common Errors

ssh: connect to host xxx port 22: Connection refusedSSH : systemctl status sshd,
Permission denied (publickey,password), authorized_keys,

Tips

Related Commands