Doing an scp gave the following error message:
Permission denied (publickey)
The reason for the above is that it asks for ec2 instance password while we use .ppk file now days.
Here are the quick steps one should follow:
- server 1
- generate the id_rsa.pub
ssh-keygen -t rsa /root/.ssh/id_rsa
or/home/ec2-user/.ssh/id_rsa
- No need to enter any passphrase
- generate the id_rsa.pub
- server 2
- Open /etc/ssh/
sshd_config/
sshd_config - If logged as ec2-user; susu su
Uncomment the lines below if they are not already
RSAAuthentication yes
PubkeyAuthentication yes
Open /root/.ssh/authorized_keys
- Open /etc/ssh/
- append contents of id_rsa.pub file of server 1 to authorized_keys of server 2