Skip to main content
Share Your Experience: Take the 2024 Developer Survey
16 votes
Accepted

Use sudo while editing over SSH?

Using TRAMP multi-hops. For instance, if you want to edit the remote file /root/salary.txt /ssh:homer@powerplant|sudo:powerplant:/root/salary.txt The example is taken from the Mastering Emacs book.
Manuel Uberti's user avatar
13 votes

Tramp mode is much slower than using terminal to ssh

I have also found the solutions on the tramp FAQ that address speeding tramp up to work pretty well. From the page, here is what I added to my configuration: (setq remote-file-name-inhibit-cache nil)...
colelemonz's user avatar
10 votes
Accepted

Magit equivalent of 'git remote add origin [email protected]:user/project.git'?

The equivalent of the git command in Magit is to set a new Remote. This is where it is in the docs Ma creates a new remote. When asked for the name of your remote, the usual answer is the name of ...
orion's user avatar
  • 845
6 votes

Fix compilation mode paths when compiling in container or remotely

If I understand your question correctly, the simplest solution that I have found is to set the variable directory-abbrev-alist to map directories in the compilation buffer to the host system. For ...
ghn's user avatar
  • 63
5 votes
Accepted

How can I use Emacs in a SSH sever that I logged in through emacs terminal?

There is Tramp. You can edit a file on another machine using the syntax /ssh:user@machine:/path/to/file. If you take sudo instead of ssh, and empty user and machine, you can edit a local file as root. ...
Michael Albinus's user avatar
3 votes

Use sudo while editing over SSH?

I wrote a command for automating @Manuel Uberti's answer. The second one is the one I'd use. It uses the first one for remote files and uses crux for local files. (require 'crux) (require 's) (defun ...
Hatshepsut's user avatar
3 votes
Accepted

How to rsync/fetch/download the folder open with ssh/tramp

Make sure that dired-dwim-target is set to t, split the frame in two windows, open a local directory in the other window with dired where you want the copy to land, mark the file that you want to ...
NickD's user avatar
  • 30.4k
3 votes
Accepted

Directory tracking in remote shell buffer

Not the best solution, but certainly a working one: Use [dirtrack-mode]. The following preparations are needed: 1. On the remote machine: Make sure the prompt of the remote shell contains the path ...
halloleo's user avatar
  • 1,345
3 votes
Accepted

Tramp hangs in "Waiting for prompts from remote shell"

I found out what my particular problem was. The server I'm trying to login to, displays a fancy motd message when logging in. This ascii-art contains some characters that emacs/tramp seems to dislike, ...
Pablo's user avatar
  • 61
3 votes
Accepted

Dired+ doesn’t work on old remote system

And not to forget the hint in the Tramp manual: Emacs computes the ‘dired’ options based on the local host but if the remote host cannot understand the same ls command, then set them with a hook as ...
Michael Albinus's user avatar
3 votes

Tramp ignores remote paths, no matter what

call-process runs local processes. For remote processes, you must use process-file instead.
Michael Albinus's user avatar
2 votes
Accepted

How to access (remote) MS Windows shared directory or files in Emacs25 running on Ubuntu 18.04

As you wrote, in emacs, the syntax is /smb:USER%DOMAIN@IP_ADDRESS:. Personally I would use the host name instead of IPADDRESS, but this shouldn't matter. Important is the DOMAIN part. This must be ...
Michael Albinus's user avatar
2 votes

How to eliminate excessive filesystem accesses that are slow over sshfs?

Perhaps use Tramp instead of sshfs. The latter can't be recognized as easily as a slow file system as it is implied by the former.
p_wiersig's user avatar
  • 1,081
2 votes

How to eliminate excessive filesystem accesses that are slow over sshfs?

If you don't need version control, disable it. (setq vc-handled-backends nil)
Michael Albinus's user avatar
2 votes

Remote machine: Your terminal lacks the ability to clear the screen or position the cursor

Use M-x term instead of M-x shell. shell isn't a terminal emulator, term is. Also a hint: term-mode has two submodes, line-mode and char-mode. You can switch between them with C-c C-k and C-c C-j. ...
jpkotta's user avatar
  • 508
2 votes
Accepted

Tramp FTP cant connect. tramp-file-name-handler: Host name must not match method "ftp"

Your syntax is wrong, it misses the trailing colon. Try C-x C-f /ftp:[email protected]:
Michael Albinus's user avatar
2 votes

Tramp hangs in "Waiting for prompts from remote shell"

Don't try to test everything the same time. Concentrate first on Tramp. Start emacs -Q in order to suppress init files. Don't use any completion package, but load C-x C-f /ssh:myserver: directly. If ...
Michael Albinus's user avatar
2 votes

How do I use tramp to launch a remote PowerShell?

The Tramp manual describes how to access a remote Windows machine. It uses Samba's smbclient program. A remote path looks like this: /smb:user%DOMAIN@machine:/share/path/to/file. The %DOMAIN part is ...
Michael Albinus's user avatar
2 votes

Preview images, and PDFs inside a SSH terminal session or inside emacsclient session via SSH?

If you run Emacs on your local machine, and open files on the remote machine via Tramp, you can view remote files as if they were on your local machine, you don't need to do anything special. ESS also ...
Tyler's user avatar
  • 22.3k
2 votes

Tell ESS to use a different R program when on a Tramp remote session

I don't know which Tramp version you use. But in the more recent versions, you can set connection-local variables. Check the Tramp manual for details.
Michael Albinus's user avatar
2 votes

Org Mode - Use remote table reference in constants

Defining Constant Values from Remote Org-Table Cell for Use in #+TBLFM: Initial Setup Create Named Table, e.g. other-table-name #+NAME: other-table-name | S | M | T | W | H | F | S | |---+---+---+---+...
Melioratus's user avatar
  • 4,678
2 votes
Accepted

gdb over ssh via tramp fails (but gdb-gud works?)

This is bug#44151, see https://debbugs.gnu.org/44151. I've fixed this in Tramp 2.4.4.3, which will be released later today on GNU ELPA. Note that this bug describes a further problem, which seems to ...
Michael Albinus's user avatar
2 votes

Dired+ doesn’t work on old remote system

Set tramp-verbose to 6, and rerun the test. There will be a Tramp debug buffer. Look for messages tagged with (6), they contain sent commands, and the responses. Perhaps you'll see what's going on.
Michael Albinus's user avatar
2 votes
Accepted

Use variable in reference with remote in Org-table

Hope this will be useful to someone (have been searching for the solution for hours!). The function to use is #+TBLFM: $3='(org-lookup-first $2 '(remote(FOO,@2$1..@>$1)) '(remote(FOO,@2$2..@>$2))...
Nre's user avatar
  • 153
1 vote

Use tramp to play remote videos on the local

When you try to invoke a shell command whilst visiting a remote buffer (a directory in your case), tramp will try to run it on the remote machine. In this case it tries to ssh to your phone and run ...
Dan Robertson's user avatar
1 vote

Running Emacs through X2Go, the bidirectional clipboard does not work, even though it works for other programs

In my case, the cause was having started Emacs as a tab of GNU Screen and connecting to it by emacsclient. After restarting Emacs from within the X2Go session, the bidirectional clipboard started ...
kdb's user avatar
  • 1,561
1 vote
Accepted

Automate delete content of remote org mode file!

Tramp supports Google drive out of the box. Try to open C-x C-f /gdrive:[email protected]:/path/to/file. Starting with Tramp 2.4, it supports also rclone. If you have configured Google drive in ...
Michael Albinus's user avatar
1 vote
Accepted

Org-mode table recalculation with a remote() formula using calc?

Not sure if this is the correct solution, or if I'll have trouble when the file gets bigger, with more tables, but it seems to work for the moment. Solution: I have used a lambda function to bind ...
Sergiu Elmi's user avatar
1 vote
Accepted

Why does emacs on a remote computing cluster behave differently depending on how the cluster is accessed?

W.r.t the 4s delay, you should probably look at the $TERM env-var (e.g. with echo "$TERM" run from the same shell from which you start emacs) and then try and look at the corresponding terminal-init-&...
Stefan's user avatar
  • 26.5k
1 vote

Tramp with ssh not asking for password - too many authentication failures

You haven't said which Tramp version you are using. However, recent Tramp versions use the auth-source package for getting the password from an authentication file. In order to disable this, just eval ...
Michael Albinus's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible