Key authentication not working
Hi,
I can't get this to work.
I am using remote SFTP backup and trying to get this to work with key authentication (password authentication works fine). But it keeps giving me this error:
Error: Validation for transport "randomname" failed: Permission denied (publickey,password).
On the destination server, I generated a 4096 RSA key with a passphrase:
After that, I copied the generated PUB key (id_rsa.pub) in ~/.ssh to authorized_keys
Then I set permissions of the .ssh and the authorized_keys folder to 600 and the pub key to 644 (also tried 600). Then I go to cPanel > Manage root"s SSH Keys and import the private key (id_rsa) and filled in the passphrase. After that, I go to the configuration of the remote destination (SFTP) and fill in the location of the private key (/root/.ssh/id_rsa. Also checked permissions and those are 600. Those are exactly the steps I did but without any success. I also generated a key with cPanel but same error. Any idea whats going wrong here? Thanks for any support!
ssh-keygen -t rsa -b 4096After that, I copied the generated PUB key (id_rsa.pub) in ~/.ssh to authorized_keys
cp id_rsa authorized_keys/Then I set permissions of the .ssh and the authorized_keys folder to 600 and the pub key to 644 (also tried 600). Then I go to cPanel > Manage root"s SSH Keys and import the private key (id_rsa) and filled in the passphrase. After that, I go to the configuration of the remote destination (SFTP) and fill in the location of the private key (/root/.ssh/id_rsa. Also checked permissions and those are 600. Those are exactly the steps I did but without any success. I also generated a key with cPanel but same error. Any idea whats going wrong here? Thanks for any support!
-
Are you trying to sftp as root, or as another username? If you're trying to sftp as another username, the key needs to go in /home/username/.ssh/authorized_keys rather than root's home (~/.ssh/ if you're in as root). 0 -
I'm running into the same issue- [backup_destination_validate] version [1].alidation for transport "keyed" failed: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). 0 -
Hello, On the host server, ensure that the /etc/ssh/sshd_config contains the following lines, and that they are uncommented; PubkeyAuthentication yes RSAAuthentication yes0 -
I am trying as root and both lines are in the sshd_config file. I also set the path to: AuthorizedKeysFile /root/.ssh/authorized_keys And restarted SSH. So that can't be the issue I think. Any more ideas? Or should I create a support ticket? 0 -
Hello :) Please open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome. Thank you. 0 -
check /var/log/secure before you go too crazy ;) 0 -
That one doesn't show any logs unfortunately :( 0 -
That is very odd. Any attempt at all to connect to the servers SSH server should be detailed in /var/log/secure on redhat/centOS systems. 0
Please sign in to leave a comment.
Comments
8 comments