-
Notifications
You must be signed in to change notification settings - Fork 0
SSH
GradedJestRisk edited this page Apr 24, 2020
·
6 revisions
Overview:
- generate:
ssh-keygen -t rsa -b 4096 -C “your_email@example.com”
- get the public key (not private):
cat ~/.ssh/id_rsa.pub
- change passphrase:
ssh-keygen -p
Overview:
- start (if not working):
eval `ssh-agent`
- list all accessible keys (.ssh) :
ssh-add -l
- add a key :
ssh-add
- remove all keys:
ssh-add -D
List:
- connect to SERVER:
ssh -i <KEY_FILENAME_WITHOUT_.PUB> <SERVER>
- expose distant port DISTANT_PORT on localhost:LOCAL_PORT:
ssh -i -L <LOCAL_PORT>:localhost:<DISTANT_PORT> <KEY_FILENAME_WITHOUT_.PUB> <SERVER>