SSH Key Based Authentication

To communicate with a remote server or you want to authenticate with ssh-key follow the following steps:

1. Client Machine: 192.168.1.1,    Hostname = test
2. Remote Server:  192.168.1.2     Hostname = server


On Client Machine:

[root@test ~]# ssh-keygen -t rsa

The above command will ask you some question. Read them and press enter.

[root@test ~]# ssh-copy-id root@192.168.1.2

It will search the generated key and ask you the password of server to copy it.  

Now try to connect with remote server using the key
[root@test ~]# ssh root@192.168.1.2
Last login: Sun Dec 10 23:45:49 2017
[root@server ~]# 

No comments:

Post a Comment