Active Topics

 


Reply
Thread Tools
mudhoney's Avatar
Posts: 31 | Thanked: 1 time | Joined on Jan 2008
#1
I apologize if this has been covered before. I did a search for 'ssh-agent' and could not find this problem.

I have my linux machines set up to authenticate SSH connections with private/public keys. I've done the same with the 'root' and 'user' users on my n800. It works as it should, except when I try to use ssh-agent to avoid typing in my pass-phrase all the time.

Running ssh-agent appears to work as usual, and I can confirm that it is running with ps aux. However, when I try to run ssh-add, I get this message:
~ $ ssh-add
Could not open a connection to your authentication agent.

Does anyone know why this is? Thanks.
 
Posts: 6 | Thanked: 0 times | Joined on Feb 2008 @ Utrecht
#2
Perhaps there's some useful info in the following tutorial?:
http://www.cleardefinition.com/page/Sync_Evolution_and_GPE_on_N800/
(about syncing GPE and Evolution over SSH)
 
Posts: 109 | Thanked: 91 times | Joined on Dec 2007
#3
Originally Posted by mudhoney View Post
I apologize if this has been covered before. I did a search for 'ssh-agent' and could not find this problem.
Really?

On most *nix systems (unfortunately, not the Nokia Tablet...bad Nokia, bad, bad, bad), there's a program called "man", which allows you to view the manual page for programs. In fact, the manual page for ssh-agent gives a detailed and surprisingly readable explanation of how ssh-agent communicates with other programs, such as ssh-add.

Unfortunately (bad Nokia), there are no manual pages on the Nokia Internet Tablet. However, being an "internet tablet", there's another way to get this information.

There's this new thing, called "google". It lets you search for things in websites other than internettablettalk.com. In fact, the fist four hits from this "google" thingy have good explanations about using ssh-agent. You might want to try this yourself...http://www.google.com/search?q=ssh-add+ssh-agent
Originally Posted by mudhoney View Post
I have my linux machines set up to authenticate SSH connections with private/public keys. I've done the same with the 'root' and 'user' users on my n800. It works as it should, except when I try to use ssh-agent to avoid typing in my pass-phrase all the time.

Running ssh-agent appears to work as usual, and I can confirm that it is running with ps aux. However, when I try to run ssh-add, I get this message:
Well, you haven't actually given any information about how you're running ssh-agent....but let's assume that it's correct.
Originally Posted by mudhoney View Post
~ $ ssh-add
Could not open a connection to your authentication agent.

Does anyone know why this is? Thanks.
Sure. This is perfectly normal...ssh-add doesn't have a magic way to connect to the ssh-agent process (of which there may be many running).

When you run ssh-agent, it opens a unix socket, as a pseudo-network method for communicating between the ssh-agent process and ssh-add. You need to supply the ssh-agent process with some information about which unix socket to use. There are several ways of doing this. The most "elegent", often used in GUI *nix desktop environments, is to make ssh-agent the parent process of the windowing system. This way, all child processes (ie., xterms, mail clients that communicate via an ssh tunnel, etc) will transparently inherit the environment settings defined by ssh-agent.

On the Nokia tablet, the GUI session is started before the ssh-agent process. When you run ssh-agent from the command line in an xterm, you need a way to tell ssh-add how to communicate with the ssh-agent process. As the manual page, or a google search, would have told you, ssh-add uses the environment variable "SSH_AUTH_SOCK" to specify the name of the unix domain socket.

You might have noticed that when you run the ssh-agent command that there's some output. In fact, if you had included that output in your initial post (in place of just saying "ssh-agent appears to work as usual"), we might know if ssh-agent is actually running correctly. The output from ssh-agent can be used to define and export the SSH environment variables.

Here's what I use in the .bash_profile on my N810:
Code:
# Find an ssh-agent socket, or start a new ssh-agent
if test -z "$SSH_AUTH_SOCK" && test -x /usr/bin/ssh-agent; then
        sock=`netstat -l 2>/dev/null|grep ssh-|cut -c 58-|head -n 1`
        if test -n "$sock"; then
                export SSH_AUTH_SOCK=$sock
        else
                eval `ssh-agent`
        fi
fi
 

The Following 3 Users Say Thank You to z2n For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 19:47.