I’m trying to set up my VPS. I keep getting the following error when I log in as either root or second user. And if I block password login I lock myself out.
sign_and_send_pubkey: signing failed for RSA “/home/e/.ssh/id_rsa” from agent: agent refused operation
I can see the id_rsa file (and .pub) files on my laptop in the folder above. I can see the authorized key on the VPS terminal under ~/.ssh (and root). But the keys don’t appear to be talking to each other. I’ve changed ownership and permissions and they all seem to have taken.
Any ideas? As far as I am aware I haven’t done anything to keys I shouldn’t have.
Thanks, Emily
Hi Emily. I found LearnLinuxTV to be a useful channel to learn various things related to Linux. Here’s a link to a SSH tutorial that he did. It is rather long but IMO worth the time spent.
Hope this helps you to figure out where the problem lies.
I have found where it is failing…but can’t see why…does anyone have any ideas??? I’ve highlighted the first line that is different from the video Midline sent me.
Only other thing I have done is change permissions on authorized_keys to 0644 instead of 0600 which I came across yesterday. Didn’t do anything for me though!
While I am also pretty new to the SSH capability, I did find an article on the web that seems to solve your problem. I will copy the steps they mention here below:
Run ssh-add command on the client machine to add the SSH key to the agent:
$ ssh-add
If ssh-add causes the message as follows, it means it is required to set more restrictive permissions on the private key file:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0744 for ‘/home/user/.ssh/id_rsa’ are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
To set the proper permissions, execute:
$ chmod 600 /home/user/.ssh/id_rsa
Once the permissions are fixed, the “signing failed: agent refused operation” issue should be solved and you should be able to SSH normally.
I’ll look in to this. I didn’t get the warning when I tried ssh-add. Private key is at 600 already. Public key was too but I changed that to 644 try. But owner ship is 700.
Just an update. I got it to work. I had generated the ssh key and during the process I was asked for a passphrase. I put one in. I deleted my key from everywhere and generated a new one without a passphrase.
Midline - I really liked that video. I went back to look at it this morning and caught that he said it is a good idea to use a passphrase but he didn’t actually put one in.
mva - I’m all caught up on my permissions codes now!