Score:1

Permission denied (publickey). while using SCP command

cl flag

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 :)

sudodus avatar
jp flag
Are you trying to use a **live** or **persistent live** Ubuntu system as server? I'm asking because of the user name 'ubuntu'. In that case I think you need a user with a password (which can be created in a persistent live system). - Otherwise, **if the system is an installed system** with a user name 'ubuntu', you may need **key authentication**. Please ask the administrator (if it is not you).
in flag
Are you connecting to an EC2 instance?
AKASH-29 avatar
cl flag
@matigo yes i have one master machine and one slave machine i just wanted to copy some file in a remote machine and pasting into my master machine
AKASH-29 avatar
cl flag
@sudodus yes it's literally a live machine before copying a file i just have checked the connectivity between them and it's working fine on a remote machine and paste it into my local machine it won't working on it it's not an authentication issue i think so
sudodus avatar
jp flag
I have never used an EC2 instance, so I'm sorry, I cannot help you much.
Score:1
in flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.