Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (12.9k points)

I am trying to transfer a file to an ec2 instance. I followed the Amazon's documentation, this is what my command looked like:

scp -i [the key's location] Documents/[the file's location] ec2-user@[public dns]:[home/[destination]]

where I replaced all the variables with the proper things, I am sure it's the correct key and it has permission 400. When I call the command, it tells me the RSA key fingerprint, asks me if I want to continue connecting. I type yes and it replies with

Permission denied (publickey,gssapi-with-mic)

lost connection

I have looked at many of the other similar questions on stack overflow and can't find a correct way to do it.

Also ssh traffic is enabled on port 22.

1 Answer

0 votes
by (18.2k points)

It seems like this is a folder permission issue. Most likely, you don't have the permission to copy to it or edit it this folder that you are trying to copy. 

You can open access for yourself if you have sudo abilities.

Even though it's not recommended, but you can try the following command:

sudo chmod 777 /folderlocation

This will give a complete read/ write/ executable permissions to anyone(hence not recommended to leave it at 777).

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...