Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6965157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:01:06+00:00 2026-05-27T16:01:06+00:00

How to login with non ec2-user account in amazon linux ami? #useradd -m sample

  • 0

How to login with non ec2-user account in amazon linux ami?

#useradd -m sample
#passwd sample
 set password

#cat /etc/passwd
sample:x:508:1002::/home/monitor/sample:/bin/bash

# cat /home/monitor/sample/.ssh/authorized_keys
command="echo 'Please login as the ec2-user user rather than root
user.';echo;sleep10"    ssh-rsa xxxxxxxxx

# chown -R sample /home/monitor/sample/.ssh

I copied /root/.ssh/authorized_keys to the new user’s .ssh directory also

At login time server says ‘server refused our key’ and no supported authentication method available popup.

How to associate sample with my existing key pair?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:01:07+00:00Added an answer on May 27, 2026 at 4:01 pm

    You copied the root keys, and not the ec2-user keys. You should copy those keys and then ensure you’ve set the proper permissions.

    cp -r ~ec2-user/.ssh ~sample

    chown -R sample:sample ~sample/.ssh

    chmod 700 ~sample/.ssh

    chmod 600 ~sample/.ssh/authorized_keys

    If this doesn’t fix the problem, run a verbose ssh connection, and paste the results (removing any pertinent info)

    ssh -i [keyfile] [user]@[ip] -v

    and I’ll try to help more.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Amazon ec2 instance running, and I have a non-root user set
I have an existing database. It has 1 non-default user (that is Without Login),
To use sftp in a script without user interaction (non-interactive). For example to login
My login system currently works as follows: Grab the user's username and password from
We have a non-SSL ASP.NET web app that allows a user to login (ASP
Login Form: $authAdapter = Zend_Registry::get('authAdapter'); $authAdapter ->setIdentity($formData['email']) ->setCredential($password) ->setCredential(1); Bootstrap: protected function _initAuth(){ $this->bootstrap('db');
The login page in my Tapestry application has a property in which the password
I have a login page where I authenticate the user. When the authentication pass,
In my previous understanding, for a web site, only login user of a web
I have a simple page that has a (non-Prototype) JavaScript pop-up for login. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.