Permission Denied (Publickey) When Using Ssh

I have Ubuntu 20.04 running in VirtualBox as my control node. I am using AWS EC2 instances (Ubuntu) for my remote servers.

Every time I try to ssh into one of my EC2 instances I get " Permission Denied (publickey) ". I generate the key with no issues, but get the error when I try to run

 sudo ssh-copy-id -i <key>.pub 

I'm really new to Linux and AWS altogether so I'm wondering if there's something misconfigured somewhere in my AWS instance.

5
Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article