3

I have tried to copy some file in tomcat using SCP command

scp ubuntu@xxxxxxx:/opt/apache-tomcat-9.0.48/conf/server.xml .

ubuntu@xxxxxxx: Permission denied (publickey).

help me to get out this

Thank in advance :)

1 Answers1

4

Based on your answers in the comments, your servers are Amazon EC2 instances, which confirms that this very much is an authentication issue. You will need to use scp with the -i option and include the .pem that you use while SSHing into the machine:

scp -i ~/.ssh/amazon.pem ubuntu@xxxxxxx:/opt/apache-tomcat-9.0.48/conf/server.xml .

Be sure to replace ~/.ssh/amazon.pem with the actual name and location of your private key.

matigo
  • 24,752
  • 7
  • 50
  • 79