2

I have to connect to remote computers through ssh. I'm using tramp (C-x d /sshx:user@myhost|su:myhost:/mydirectory) and I can sudo as root on directories in this machine. As it is very convenient, I would like to bookmark the location.

After giving a name to the bookmark, I can see that my latest bookmark looks like 'my newbookmark /su:root@myhost:/mydirectory', therefore forgetting the first half of the location. And when I try to comeback to it (after closing emacs for example), I have a message "Host 'myhost' looks like a remote host, 'su' can only use the local host".

How would it be possible to bookmark the whole location?

Many thanks.

2

I don't know whether it is possible to bookmark the whole remote path as you type it. But please be aware, that the pipe notation /sshx:user@myhost|su:myhost: is called ad-hoc proxies, it is not intended to survive an Emacs session. I recommend you to add the proxy configuration in your .emacs file, as described in the Tramp manual:

(add-to-list 'tramp-default-proxies-alist
             '("\\`mydomain\\'" "\\`root\\'" "/sshx:user@%h:"))

From now on, you could always use /su:myhost: as remote identification.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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