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
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, eitherssh user01@mymachine
orssh -l user01 mymachine
.