techarticles

For many reasons we need to access remote server automatically without providing password. Specially when you need to copy file through script or programming from one server to another server. We know that SSH is a secure protocol to access remote server. Here we will show how we can access remote server without providing password. We have two servers: cgvm01 and cgvm02 ; and we will automatically login from cgvm01 to cgvm02.

Step 2: Copy Key to remote host

[[email protected] ~]# ssh-copy-id [email protected]
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed — if you are prompted now it is to install the new keys[email protected]’s password:

Number of key(s) added: 1

Now try logging into the machine, with: “ssh ‘[email protected]′”
and check to make sure that only the key(s) you wanted were added.

Here cgvm01 is the remote host. You need to provide its password against the provided user.