Reyansh Kharga
Reyansh Kharga

Reputation: 346

Can't use scp to copy files for a non-ubuntu user

I have an ubuntu ec2-instance. I have 2 users for this instance. One is the default ubuntu user and the other is newuser that I created.

I am logged in to my bastion host and trying to copy a file from bastion host to other instance for newuser but I am getting Permission denied (publickey). error.

scp hello.txt [email protected]:/home/ubuntu works fine. But scp hello.txt [email protected]:/home/newuser gives the aforementioned error.

Any help will be greatly appreciated.

Upvotes: 0

Views: 108

Answers (1)

avermaet
avermaet

Reputation: 1593

According to the Amazon docs, you need to create a new key for your newly added user newuser. Check this link where it is discribed what you need to do. Especially the Key Pairs for Multiple Users section should cover what you probably need.

Upvotes: 1

Related Questions