I am not able to scp from one EC2 instance to another EC2 instance. From my laptop I am able to ssh into each instance without issues.
I have two instances.
#worker1 ec2-107-20-7-57.compute-1.amazonaws.com #master ec2-50-19-8-109.compute-1.amazonaws.com
Here is what I have done so far.
I made a new key pair on the master node
ssh-keygen -t dsa
I copy-and-pasted the id_dsa.pub from the master node to my laptop
scp -i ec2key.pem firstname.lastname@example.org:/home/ubuntu/.ssh/id_dsa.pub /Users/me/somefolder
I copy-and-pasted the id_dsa.pub file from my laptop to the worker node
scp -i ec2key.pem /Users/me/somefolder/id_dsa.pub email@example.com:/home/ubuntu/.ssh
On the worker node I appended the id_dsa.pub file to my authorized_keys file
cat id_dsa.pub >> authorized_keys
I created a file on the master node: /home/ubuntu/test.txt and then tried to scp this file from the master node to the worker node
scp -v -i firstname.lastname@example.org:/home/ubuntu/.ssh/id_dsa email@example.com:/home/ubuntu/test.txt firstname.lastname@example.org:
I got the following result
Permission denied (publickey).
- I’m using a Mac.
- The end goal is to set up a Beowulf cluster similar to what is mentioned here: http://techtinkering.com/2009/12/02/setting-up-a-beowulf-cluster-using-open-mpi-on-linux/
ssh-copy-id to ensure that the key is copied correctly and that permissions on the relevant files/directories are correct.
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.