Ubuntu – How to get gnome-keyring-daemon to prompt for ssh-key password in the terminal instead of the GUI

12.04gnome-keyringguissh

When accessing an ssh-key with a password for the first time in a gnome session, it's so much clearer for the password prompt to appear in the terminal I'm running the ssh command in. Instead, though, gnome-keyring-daemon prompts with a GUI pop-up that can easily get lost on different workspaces.

How can I make gnome-keyring-daemon prompt me in the terminal rather than with a GUI? It should look like this:

$ ssh name@server.com
Enter password for ssh key `/path/to/my/key.dsa`: 

This is the prompt that appears in a non-X session, for instance.

Best Answer

If you don't insist on using gnome-keyring it is easy. ssh-agent is the tool you want. You can add keys to the running agent with ssh-add path/to/keyfile and list the active keys with ssh-add -l.

After you have added a key to the agent you can use ssh like you are now, but the keys are provided by ssh-agent.