-
ssh-copy-id user@hostname
Login without password -
ssh-keygen -R hostname
Remove entries in~/.ssh/known_hosts
Connect via ssh alias
by setting the alias in ~/.ssh/config
ssh [email protected] -p 4000
Host alias
HostName 10.10.10.10
Port 4000
User user
ssh -J [email protected]:4000 [email protected]
Host alias
HostName 192.168.0.10
ProxyJump 10.10.10.10:4000
User user
ssh -L 6000:localhost:5901 [email protected] -p 4000
Host alias
HostName 10.10.10.10
Port 4000
LocalForward 6000 localhost:5901
User user
ssh -L 6000:localhost:5901 [email protected] -p 4000 -o 'LocalCommand=echo "Connect localhost:6000'
Host alias
HostName 10.10.10.10
Port 4000
LocalForward 6000 localhost:5901
LocalCommand echo "Connect localhost:6000"
PermitLocalCommand yes # or set in General Rules section
User user
ssh [email protected] -p 4000 -t -o 'RemoteCommand=cd folder/ && bash -l'
Host alias
HostName 10.10.10.10
Port 4000
RemoteCommand cd folder/ && bash -l
RequestTTY force
User user
Host *
AddKeysToAgent yes # MacOS only
UseKeychain yes # MacOS only
ServerAliveInterval 60 # For not disconnecting
ServerAliveCountMax 10 # For not disconnecting
PermitLocalCommand yes