mona
mona

Reputation: 109

permission denied error while trying to copy file from my desktop to a ec2 instance using scp command

I am trying to copy a file from my windows machine to ec2 instance. I am using following command to do so.

scp -i "C:\Users\abc\AWSServer\MyEc.pem" "C:\Users\ABC\Mypython.py" ec2-user@_._.__.__:/home/ec2-user/PythonProgram

I am getting the permission denied error like follows:

scp: dest open "/home/ec2-user/PythonProgram/Mypython.py": Permission denied
scp: failed to upload file C:/Users/ABC/Mypython.py to /home/ec2-user/PythonProgram

does anybody knows the solution.

Upvotes: 0

Views: 49

Answers (1)

mona
mona

Reputation: 109

Okay i got the answer. i changed the permission to the directory using chmod command

sudo chmod a+w /home/ec2-user/PythonProgram

Upvotes: 0

Related Questions