Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I recently stopped using a full desktop environment in ubuntu 11.10 (tired of unity) but I'm trying to get some of the desktop environment back. I'm currently trying to get the "Unlock private key" dialog to show up when I'm trying to use a new ssh key. However, currently the prompt only shows up in the terminal window instead of the gui, which means that it isn't using a global ssh-agent and hence I need to enter the key password multiple times before I restart.

I think what I want is gnome-ssh-askpass and I tried setting SSH_ASKPASS but that didn't work: http://www.linuxquestions.org/questions/linux-software-2/how-to-replace-ssh-askpass-with-ssh-askpass-gnome-843220/

I've also tried gnome-keyring-daemon as gnome-keyring-daemon --components keyring,pkcs11,ssh but that didn't help: http://live.gnome.org/GnomeKeyring/Ssh

share|improve this question
add comment

4 Answers 4

I think what you're really looking for is keychain, which is similar to the ssh-reagent you mention. Once configured in your .bashrc it'll prompt for the passphrase of the key(s) you asked it to manage only when you launch the first terminal after login and makes sure every new terminal knows about your ssh-agent.

share|improve this answer
add comment

To resolve the issue of entering the password multiple times, enter this command the first time you open a terminal: ssh-add


No need to enter the password until you log out.

share|improve this answer
    
I don't really like that solution because it's irritating doing that for every new terminal window (I tend to make many windows). I currently use ssh-reagent pastebin.com/HBeUzZhs but even doing that in every window is irritating so I might add it to my .zshrc –  Jason Axelson Jan 18 '12 at 19:17
    
No need to do it for every window, once is enough. –  konrad Jan 27 '12 at 8:19
add comment

It should be automatic if you've set up the ssh key on both systems. With a default installation, I've never had to do anything else.

In case you haven't done this, here is the way it's done:

Generate the key (either RSA or DSA). I think RSA is more common.

ssh-keygen -t rsa

or

ssh-keygen -t dsa

Transfer the key to the remote system:

ssh-copy-id username @ hostname

If not using the standard port 22: (note quotes are required around argument)

ssh-copy-id username @ hostname -p portnum"

If using DSA, you need to use a something like:

ssh-copy-id -i path to id_dsa

Once I've done that, I get the dialog. In the past, I remember that if I ran the terminal in a certain way, it wouldn't give the dialog, but I can't remember the details. I think it was when I created a hotkey for a custom command to set the directory due to a bug where the terminal kept coming up in the root directory even though it knew my home directory.

share|improve this answer
add comment

I've added this as a new answer because I didn't want it to get last in my other answer.

I have found that if you start gnome-terminal, or xterm or other terminals (I believe) from a custom hotkey rather than the built in hotkey or menu, then it behaves totally differently for SSH, and will not use the keyring. In fact, when I just tried it on my system after remembering this problem, I actually got an error, where it always works from the default methods.

share|improve this answer
    
This might be related since I am using Awesome WM's Super+Enter shortcut to launch the terminal. –  Jason Axelson Feb 23 '12 at 20:48
    
Do you run Awesome with Gnome? If so, maybe you can get the SSH working with the standard WM first, then if that works, you'll know where to look for solutions. –  Marty Fried Feb 24 '12 at 17:42
    
It was working fine before I switched to AwesomeWM –  Jason Axelson Feb 24 '12 at 20:08
    
Well, wish I could help further. I tried taking a look at Awesome once, but never got far, and didn't feel like spending a lot of time figuring it out. It looks like it might be interesting, but I don't know that it really does anything I can't do with Compiz, except maybe using less resources. –  Marty Fried Feb 24 '12 at 21:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.