Control Web Panel

WebPanel => CentOS 7 Problems => Topic started by: stevland on June 28, 2018, 10:25:31 PM

Title: SSH access for a non-root user
Post by: stevland on June 28, 2018, 10:25:31 PM
I can't seem to find any information regarding my question.

I can connect to my server at root using SSH using key-based authentication.

But I am am also trying to setup SSH access for a non-root user on the server.

Shell access is checked ✓ under Edit User.

Ideally I would like to use a unique SSH key for this user, but I have no idea how to set that up.

In the meanwhile, I am trying to connect as that user. But I receive

Code: [Select]
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
If I try and connect using the root's key I receive

Code: [Select]
Server refused our key
What am I missing?

Title: Re: SSH access for a non-root user
Post by: stevland on June 28, 2018, 10:37:33 PM
Nevermind. Figured it out. I'll share the solution for some other noob who is sure to ask the same question.

I just needed to create a keypair using ssh-keygen -f <username> which put username and username.pub in my user's /home/.ssh directory.

I then had to create a file called authorized_keys in the same directory and copy the contents of username.pub into it.

I then use the username file as the private key when connecting as username@domain.com from PuTTy/BitVise/MobaXterm/etc.
Title: Re: SSH access for a non-root user
Post by: albatuni on September 13, 2019, 12:34:44 AM
Thanks Stevland!