Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 6779  / 2 Years ago, thu, september 8, 2022, 11:44:23

The remote server requires a private key and passphrase for authentication. I'm trying to connect to the server as root (on that server) from Nautilus running on behalf of my non-root account on my local Ubuntu desktop. The private key that is needed for authentication is not located in ~/.ssh (I've already got other keys there) but I have it in another directory.



In addition to the obvious approach, I tried putting root@server in the "Server" field and leaving "User name" and "Password" fields blank, putting the passphrase in the "Password" field, but it still says "Permission denied" and it doesn't ask for the private key at any point.



I also tried ssh-add path/to/privatekey, but it says "Could not open a connection to your authentication agent.", however I'm not sure if ssh-add is even relevant here.



I can ssh into the server from the terminal just fine with



ssh -i <...>/id_rsa root@server


and answering the passphrase question that follows.


More From » nautilus

 Answers
0

I don't see why key selection dialogue should appear at all. It's up to the server to offer authentication methods it's willing to accept and up to the client to provide the credentials.



One of the most common methods for providing those details is using the ssh-agent which you don't appear to be running. This is a little snippet I've put in my ~/.profile to make sure my ssh-agent is always running:



run_ssh_agent() {
ssh-agent | grep -vi 'agent pid' > ~/.ssh-agent
. ~/.ssh-agent
}

if [[ -f ~/.ssh-agent ]]; then
. ~/.ssh-agent
if [[ -n ${SSH_AGENT_PID} ]]; then
if ! ps -p ${SSH_AGENT_PID} | grep 'ssh-agent' &>/dev/null; then
run_ssh_agent
fi
fi
else
run_ssh_agent
fi


Put the code there, log out of your X session, log back in, open a terminal and add your key to your agent:



ssh-add /path/to/your/private_key


Verify that it's added by running ssh-add -l and connect to the server using Nautilus without providing the password.


[#33871] Friday, September 9, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
atereress

Total Points: 79
Total Questions: 106
Total Answers: 119

Location: Federated States of Micronesia
Member since Sun, May 16, 2021
3 Years ago
atereress questions
Wed, Aug 4, 21, 03:15, 3 Years ago
Sat, Apr 16, 22, 17:34, 2 Years ago
Thu, Dec 22, 22, 05:56, 1 Year ago
Sun, May 15, 22, 15:59, 2 Years ago
;