Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use ssh to connect to a remote machine where a file is.

Once the connection is established, if I run emacs the_file in the terminal, instead of launching my local Emacs, it opens an editor inside the terminal which is very modest...

Does anyone know how to open this file in a normal emacs session?

share|improve this question
up vote 7 down vote accepted

You could use tramp. Simply start your local emacs, open file (ctrl+x+f) and type the full address like this: / So assuming the server is at and the file at /home/me/test.txt, the address to type would be / This will open the file in the local emacs instance.

(Note that this does not require an additional manual ssh connection.)

Of course there is also the second option to use sshfs to mount the remote directory on a local address and open the local version.

share|improve this answer
Thanks for your comment... when I use ssh, I should write ssh a_name@server, and enter password... how should I enter this in Emacs? – SoftTimur Nov 14 '11 at 15:49
got it... I should write /server:/... directly which normally includes a_name, and Emacs asks me the password... Thank you... – SoftTimur Nov 14 '11 at 15:56
your welcome :-) – xubuntix Nov 14 '11 at 15:59
SoftTimur: can you please give an example with user name included? – Campiador Nov 18 '15 at 0:44

Your Answer


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.