0

I have a CentOS server and I am trying to configure a SSH connection using a SSH Public Key. What I did:

  • Created a user and a group (just to avoid root group), I created a group called mySSHUsers and every user that I registered I assigned to that group
  • Generated the SSH-PublicKey and pasted into the authorized keys (as some tutorials explains)
  • chown username:username .ssh

I'm logged as root, I created a user called User00 under the group mysshUsers But then, in the client machine I cannot connect to the server, checking the SSH logs files I get:

Apr  9 16:35:14 qor sshd[2669]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=xx.xx.xx.xx  user=root
Apr  9 16:35:14 qor sshd[2669]: pam_succeed_if(sshd:auth): requirement "uid >= 1000" not met by user "root"

So, am worried why if I say that my user is User00 in the logs files appears as if root is trying to connect? As far as I know, SSH doesn´t like connections as Root, and that's why I get "uid >= 1000" not met by user "root" so, am starting to believe that I am not configuring the users in a good way

I already tried editing the PAM rules (it's not a good practice) but then I get another error connecting, it said something like: password incorrect which password? So, I came back and enabled again the PAM rule because I don't want that kind of unsafe things in the server

EDITED:

Exactly, I trying to configure cloud9 to access the server via SSH, they generated me a public key, so then, I copied and pasted that key into the authorized_keys file, I have a folder under /home for every user, the structure is like:

  • |-Home
  • |---User00
  • |-----.ssh
  • |--------authorized_keys (file containing authorized ssh keys)
  • |--------User00.pub (file generated when I typed ssh-keygen)
  • |---User01
  • |---User0n
  • By default, you log in to the remote machine using the same username as you are using on the local machine. Since you say you are logged in as root, if you execute ssh mymachine, you will be attempting to log in as root on that machine. If you want to log in as a different user, you need to specify that on the command, either ssh user01@mymachine or ssh -l user01 mymachine. – user4556274 Apr 9 '17 at 17:52
  • @user4556274 no, when I say login as root is that I am logged as root when am creating the users and all the stuffs. I edited to provide more info – Sredny M Casanova Apr 9 '17 at 18:03
  • Explain what steps did you take to create the users (commands) and what commands do you use to connect to the server. – Jakuje Apr 9 '17 at 19:57
0

If you were attempting to access ssh as user "user00" and got those log entries then you seem to have created the user account with uid 0. Unix accounts are identified by an integer user id; the text is just an associated tag to make it easier for humans to understand. But it is possible to create multiple aliases (text entries) with different passwords for the same uid. You can verify this by checking the entries in /etc/passwd for root and user00.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.