Connections, forwarding and tunneling | |
---|---|
connection to remote system | ssh [email protected] |
ssh [email protected] -p PORTnbr |
|
with graphics-forwarding | ssh -X [email protected] |
ssh -Y [email protected] |
|
tunneling | ssh -R remPort:remote_host:locPort [email protected] |
ssh -L locPort:remote_host:remPort [email protected] |
|
ssh -fN -[R _or_ L] port:remote_host:port [email protected] |
|
remote execution | ssh [email protected] "remote_cmd_to_exec" |
ssh-keygen -t ed25519
ssh-keygen -t rsa -b 4096
# key generation with comments and specified location
ssh-keygen -t ed25519 -C "USER@laptop cluster-X" -f $HOME/.ssh/USER_clusterX_ed25519
# ssh using specific key file
ssh -i $HOME/.ssh/USER_clusterX_ed25519 [email protected]
ssh-copy-id -i $HOME/.ssh/id_ed25519.pub [email protected]
# copying over keys to remote system
cat $HOME/.ssh/id_ed25519.pub | ssh [email protected] "cat >> $HOME/.ssh/authorized_keys"
ssh-add key-file
ssh-add key-file -t life
# -v activates the "verbose mode": resulting in printing debugging messages
# helpful in diagnosing connection, authentication, and configuration problems
# Multiple -v options increase the verbosity, the maximum is 3.
ssh -v [email protected]
ssh -vv [email protected]
ssh -vvv [email protected]
Last Modified: Oct. 12, 2022 -- v 0.1