I like to copy a file from one server
server1 from path
path1 to another server
server2 to path
path2.
User logging in both the servers are same say
user1
I tried to use ssh to generate public/private key pairs and then copy without prompting for password.
These are the steps i followed
1. Public/private key pairs (identity/identity.pub) are generated in home/user1/.ssh in
server1. using the following command
ssh-keygen -t rsa
2. identity.pub in
server 1 is copied to home/user1/.ssh/authorized_keys in
server 2.
scp .ssh/id_rsa.pub
user1@server1:/home/user1/.ssh/authorization_keys/
(this scp is done by providing the password. i double checked this copy and i can confirm this copy done properly)
3. Tried the following command in
server1
scp path1/file1 user1@server2:/path2/file2
I believe it should not ask for the password and copy should happen smoothly. But it is still prompting for password. Why is it still asking for password?
And also note that permissions for .ssh directory in both servers are set to 600. Let me know where i went wrong.
Please help me in this issue. I am breaking my head for one day for this.