Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

772
Views
Creating a user and adding public key on aws ec2 instance

I've created a user and copied the public key to .ssh/authorized_key for that new user and also I've set the pubkeyauthentication to yes on /etc/ssh/sshd_config after saving the file restarted the sshd service.

When I try to ssh from the new user I am getting error:

Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

Am I missing any step here to ssh from the new user account?

When I check the status for sshd.servive I see error:

AuthorizedKeysCommand /opt/aws/bin/eic_run_authorized_keys xxxx SHA256:84NyibLXFppE4BGIM+1e5iO...status 22
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Had the same issue error: AuthorizedKeysCommand /opt/aws/bin/eic_run_authorized_keys ec2-user.

Make sure the file permission is user only (600) in the $HOME/.ssh directory on the SSH client side host.

  • "error: AuthorizedKeysCommand /opt/aws/bin/eic_run_authorized_keys ...snip... failed, status 22" error #20

FYI

To debug:

sudo tail -f /var/log/secure to monitor the reason why SSH refuses the connection.

Make sure $HOME/.ssh/authorized_key content on EC2 instance is correctly match with your ssh private key in the SSH client host.

Make sure correct private key is being used, use -i option to explicitly specify which key you use.

over 4 years ago · Santiago Trujillo Report

0

You might want to check the algorithm you are using to generate the key.

I saw exactly the same error message when using the ECDSA algorithm but fixed the problem by using RSA instead (ssh-keygen -t rsa).

If you want to dig deeper you can try

ssh -Q key 

to get a list of supported key types.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!