tags:

views:

298

answers:

2

How can I edit files on my remote host using my local Emacs when I can access the remote host only through SSH with public key authentication? Tramp handles normal password logins pretty well but I can't figure out how to get it work with key pairs. I'm using unix/linux on both ends.

+2  A: 

The TRAMP user manual has the information you need.

Trey Jackson
A: 

If you are on Windows you can use plink with tramp easily. You have to make sure the plink binary is in your path and have to customize the variable (M-x customize-option) tramp-default-method to plink which combined with pageant would get you what you want.

I let you read the putty home page how to configure pageant to add your key.

There is the method plinkx as well which use the profile name so when you do a :

C-x C-f /putty_profile:

It will get the putty_profile from your putty saved profile name.

If you are using Linux usually modern distros should have the gnome keyring (named as well seahorse) starting X with a global SSH agent. Example on my debian distro :

chmouel@lutece:~$ ps aux|grep ssh-agent
chmouel   2917  0.0  0.0   4904   552 ?        Ss   Aug30   0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /usr/bin/seahorse-agent --execute x-session-manager

if you do a ssh-add (making sure you have identity in your ~/.ssh properly configured) it should request for your password and identify for all your X session.

If it does not happen you probably have a problem somewhere else in your distro.

Chmouel Boudjnah