Skip to content

Latest commit

 

History

History
35 lines (29 loc) · 538 Bytes

File metadata and controls

35 lines (29 loc) · 538 Bytes

SSH

gen key as local machine

ssh-keygen -t rsa -b 4096
# or
ssh-keygen -f ~/.ssh/id_rsa_myserver -b 4096

copy key to server

ssh-copy-id -i /root/.ssh/id_rsa.pub root@myserver

login with key

ssh -i .ssh/id_rsa username@192.168.XXX.XXX

Register RSA SSH key for host:

vim ~/.ssh/config
Host myserver
  User sven
  IdentityFile ~/.ssh/id_rsa_myserver
  IdentitiesOnly yes

Host 192.168.XXX.XXX
  User sven
  IdentityFile ~/.ssh/id_rsa_myserver
  IdentitiesOnly yes