How to open a remote file (ssh) with my local Emacs?
You could use tramp. Simply start your local emacs, open file (ctrl+x+f) and type the full address like this: /the.server.name:/the/path/to/the/file
. So assuming the server is at example.com
and the file at /home/me/test.txt
, the address to type would be /example.com:/home/me/test.txt
. 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.
Related videos on Youtube
SoftTimur
Updated on September 18, 2022Comments
-
SoftTimur over 1 year
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?
-
Admin almost 3 yearsThis is a useful answer, worked for me: stackoverflow.com/a/20624538/2188550
-
-
SoftTimur over 12 yearsThanks for your comment... when I use
ssh
, I should writessh a_name@server
, and enter password... how should I enter this in Emacs? -
SoftTimur over 12 yearsgot it... I should write
/server:/...
directly which normally includesa_name
, and Emacs asks me the password... Thank you... -
xubuntix over 12 yearsyour welcome :-)
-
Behnam over 8 yearsSoftTimur: can you please give an example with user name included?