SSH - andreydiveev/wiki GitHub Wiki
Agent forwarding:
ssh -A user@host
Show loaded keys:
ssh-add -l
Add key to agent:
ssh-add ~/.ssh/id_rsa
Remove from known_hosts:
ssh-keygen -R mydomain
~/.ssh/config:
Host *
ServerAliveInterval 10
Disable login by password (edit /etc/ssh/sshd_config
and service ssh restart
):
PermitRootLogin without-password
PasswordAuthentication no
Port forwarding:
3307
: local port
3306
: destination port
-N
: not execute a remote command (no shell)
-L
: defines port-forwarding
-f
: go to blackground
user@remote
: proxy host
127.0.0.1
: destination host
ssh -N user@remote -L 3307:127.0.0.1:3306