skip to Main Content

I launched an instance & downloaded my secret key. I’ve attempted this on 2 different devices and instances. Im trying to connect to the instance so I can upload files. Whenever I attempt to connect, this permission denied message displays.

Note I’ve downloaded and used openSSH


PS C:WINDOWSsystem32> ssh -i C:Users*Downloads*key.pem @ec2-.us-west-2.compute.amazonaws.com
The authenticity of host ‘ec2-
.us-west-2.compute.amazonaws.com (
...
)’ can’t be established.
ECDSA key fingerprint is SHA256:
.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added ‘ec2-
.us-west-2.compute.amazonaws.com,...‘ (ECDSA) to the list of known hosts.
*@ec2-
**.us-west-2.compute.amazonaws.com: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
PS C:WINDOWSsystem32>


P.S. This is my first post, so constructive criticism on etiquette is welcome 🙂
Recently started my first job (an internship really) in the IT field. 3 months ago working for a start-up. Im hoping to migrate eventually to something in the field of cloud security, OSINT, DevSecOps, Web Development. Passionate about information security, open source software.

I followed this tutorial from amazon on how to connect to my instance
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/openssh.html

2

Answers


  1. Looks like it’s an issue with .pem file permissions. Check this video & see if you can resolve the error.

    You can use puttygen to get ppk file which is helpful to SSH from windows.
    If you want to use .pem files, mobaxterm is good software to use

    Login or Signup to reply.
  2. You are very welcome to the community, it’s nice to know you started your first Job!

    To get you started on how to connect to the AWS Linux instance there is a nice KB article Connect to your Linux instance from Windows using Windows Subsystem for Linux and another one using putty look at here & another SO thread.

    There are a few thing you need to learn as Prerequisites:

    1. Verify that the instance is ready
    2. Verify the general prerequisites for connecting to your instance
    3. Install the Windows Subsystem for Linux (WSL) and a Linux distribution on your local computer
    4. Copy the private key from Windows to WSL

    Then use :

    ssh -i /path/key-pair-name.pem instance-user-name@instance-public-dns-name
    

    OR

    ssh -i /path/key-pair-name.pem instance-user-name@instance-IPv6-address
    

    From using your Windows CMD:

    PS C:WINDOWSsystem32> ssh -i C:Users<user_name>Downloadstestkey.pem [email protected] 
    

    OR

    PS C:WINDOWSsystem32> ssh -i C:Users<user_name>Downloadstestkey.pem ec2-user@<Some_IP_Address> 
    

    Better Use mobaexterm and copy user key in there and you will there:
    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search