Skip to content

Latest commit

 

History

History
62 lines (46 loc) · 1.92 KB

ssh-summary.md

File metadata and controls

62 lines (46 loc) · 1.92 KB

SSH Summary

Connections, forwarding and tunneling

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"

Keys

Generation

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]

Transfer

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"

Agent to recall key

ssh-add key-file
ssh-add key-file -t life

Troubleshooting

Debugging (verbose mode)

# -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]

More about ssh


Last Modified: Oct. 12, 2022 -- v 0.1