Editing remote files with emacs and tramp
| tags: programming, ubuntu
Our web pages are in AFS space, which would be great but AFS is a pain. The security policy requires me to login with a password in order to get a token in order to access an ACL protected directory. I decided to see if I could get the emacs package tramp
to help me with this. Tramp will use scp to retrieve remote files and to write them on save. How can I get it work with AFS?
Here is one approach. I created a file ~/.ssh/config
with these lines:
Host swan
ControlPath /tmp/ssh_swan_gb
I already have an alias that forces ssh to use a password to login instead of my usual keys.
alias sshl='/usr/bin/ssh -o PreferredAuthentications=password'
So I login with sshl swan -M
.
Now a later scp
will inherit my AFS tokens. So with emacs I can type
^X^F//swan:public_html/foo/foo.cgi
to edit a file on the remote host.