SOLVED Wheel user SSH keys

Operating System & Version
Centos 7.8
cPanel & WHM Version
v90.0.15

webtipster

Well-Known Member
Aug 27, 2016
52
8
8
Atlanta, GA
cPanel Access Level
Website Owner
Hi guys,

Trying to generate keys for wheel user but keep getting "Server refused our key" in PuTTY.

Here's the steps I took:
  1. Login to SSH as wheel user
  2. Ran command
    Code:
    ssh-keygen -t rsa
  3. Copied the public key from /home/wheeluser/.ssh/
  4. Authorized the public key through WHM.
  5. Converted the private key to PPK for PuTTY.
  6. Used the PPK inside putty AUTH.
  7. Login to server is prompted with "Server refused our key"
What steps did I miss? I probably need to get some sleep.

Thanks in advance!
 

webtipster

Well-Known Member
Aug 27, 2016
52
8
8
Atlanta, GA
cPanel Access Level
Website Owner
I've tried the following as well:
  1. In PuTTY generate new key.
  2. In WHM -> Manage root’s SSH Keys -> Insert Key -> paste the new keys generated from PuTTY.
  3. Authorize the key
  4. In PuTTY use the Private key under Connection->SSH->AUTH
  5. Login as: wheeluser
  6. "server refused our key"
Same results. Any ideas?
 

webtipster

Well-Known Member
Aug 27, 2016
52
8
8
Atlanta, GA
cPanel Access Level
Website Owner
DUHHHH... Getting some sleep helped.

For all of those struggling with the same sleepless nights problem, make sure that you have authorized_keys in the .ssh directory for that wheel user. If not run the following while you are inside the home/$USER/.ssh/ directory:
Code:
touch authorized_keys
chmod 600 authorized_keys
cat id_rsa.pub >> authorized_keys