0 votes
1 view
in AWS by (19.2k points)

I am trying to use my Mac Terminal to scp a file from Downloads (phpMyAdmin I downloaded online) to my Amazon EC2 instance

The command I used was:

scp -i demo.pem phpMyAdmin-3.4.5-all-languages.tar.gz  [email protected]:~/.

The error I got: Warning: Identity file demo.pem not accessible: No such file or directory. Permission denied (publickey). lost connection

Both my demo.pem and phpMyAdmin-3.4.5-all-languages.tar.gz are in Downloads, so then I tried

scp -i /Users/Demo/Downloads/demo.pem /Users/Demo/Downloads/phpMyAdmin-3.4.5-all-languages.tar.gz  [email protected]ute-1.amazonaws.com:~/.

and the error I got: Warning: Identity file /User/Demo/Downloads/demo.pem not accessible: No such file or directory. Permission denied (publickey). lost connection

Can anyone please tell me how to fix my problem?

1 Answer

0 votes
by (44.6k points)

Specify the user to ec2-user, for instance:

scp -i your-key.pem phpMyAdmin-3.4.5-all-languages.tar.gz [email protected]:~/.

Check out this - Connecting to Linux/UNIX Instances Using SSH. Also, note that “ubuntu” may be the default user if you are running an Ubuntu instance.

For SSH to work, your key should not be publicly visible

chmod 400 your-key.pem

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...