Monday, March 16, 2020

 

How to Configure a Password-less SSH 

1) Create the key pair using the command ssh-keygen

2) The default key pair is  ~/.ssh/id_rsa (private key) and ~/.ssh/id_rsa.pub (public key) 

3) Copy the public key in clipboard using the command pbcopy < ~/.ssh/id_rsa.pub

4) On the remote server append your copied public key 

pbpaste > ~/.ssh/authorized_keys

5) SSH into remote server without password ssh -i ~/.ssh/id_rsa <remote_server_name>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#on local machine

ssh-keygen

pbcopy < ~/.ssh/id_rsa.pub
  

#on remote server

pbpaste > ~/.ssh/authorized_keys

#on local machine

ssh -i ~/.ssh/id_rsa <remote_server_name>

Refer to documentation to learn more about SSH.




No comments:

Post a Comment