Hot answers tagged

23 votes
Accepted

Tramp/Dired transfers files inline over ssh instead of using scp externaly

When you are saying "I am using tramp via ssh" I suppose you open a file like /ssh:host:/path/to/file. This is supposed to use always the ssh method. If you want to use the scp method, you shall use /...
user avatar
16 votes

Magit, how to use system's ssh agent and don't ask for password

Another solution for the lazy is to just use a package that handles exactly this case (setting Emacs' keychain-related environment variables): Install and add to your init.el package keychain-...
user avatar
  • 326
15 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.
user avatar
13 votes
Accepted

How can I quit Emacs from within a term within Emacs?

There are a few answers here. Quitting Emacs without C-x C-c First, you can quit emacs by running the command that C-x C-c is bound to: M-x save-buffers-kill-terminal. Alternatives to recursive ...
user avatar
  • 8,536
12 votes
Accepted

Using Tramp for logs

auto-revert-tail-mode is great, but it has its limits. Therefore I prefer to use an asynchronous shell command. Open the remote directory in dired, position the cursor to the file you want to watch, ...
user avatar
11 votes
Accepted

TRAMP vs ssh to remote emacs

Since TRAMP uses ssh by default, the real question you are asking is if you should use local or remote emacs to edit remote files. Right? Is it considered better to use ... There is no better, ...
user avatar
  • 5,305
11 votes

fix or workaround: "Terminal is not fully functional"

Quick answer That's not an issue, it's a statement of fact. M-x shell isn't a fully functional terminal - it simply can't do what you want it to do. If you want a full terminal emulator in emacs, you ...
user avatar
  • 20.1k
10 votes

Tramp unable to open some files

I had a similar problem when trying to open/save plain ASCII files via tramp's sftp: the files were fine, I was able to edit them with, for example,nano, but trying to open them via tramp would get ...
user avatar
  • 201
10 votes

Magit asks for passphrase for ssh key every time

Running ssh-agent and hoping for the best is not enough. ssh-agent hands out the decrypted private key to everyone asking on a specific socket. The problem is that the socket is not always the same ...
user avatar
  • 24.2k
8 votes
Accepted

Tramp with 2-factor authentication

You'll have to customize the tramp-password-prompt-regexp variable with the second prompt to finish the 2-factor authentication. The remote shell setup part of the manual has a simple example. This ...
user avatar
  • 5,305
7 votes

TRAMP is unbearably slow (OSX, ssh)

I know it's an old question and that you maybe don't care about the answer now but I do faced the same issue. I was pretty sure it was OS X related but in fact lags and timeouts were caused by my ...
user avatar
  • 81
7 votes

TRAMP vs ssh to remote emacs

I agree with Emacs User: Neither approach is objectively "better". If you don't have any obvious compelling reason to go with one or the other, then it's really just a subjective balance between ...
user avatar
  • 43k
7 votes

Can Emacs use tramp to run in an interactive session on a remote HPC node?

It sounds like you should extend tramp-methods, adding a new method which is similar to the sudo method but uses qsub -I instead. You would then be able to use a multi-hop tramp path to first connect ...
user avatar
  • 11.2k
7 votes
Accepted

Using with-editor

As pointed out by @Nsukami and briefly summarized in my comment he linked to, this is not supported out-of-the-box yet. But by following these suggestions you should be able to get it to work. What ...
user avatar
  • 24.2k
7 votes
Accepted

Fetch configuration from remote (e.g. Github) at startup

I would do this outside of Emacs, with a wrapper script that pulls the updated config first. Something like this: #! /bin/sh cd ~/.emacs.d && git pull --rebase exec /usr/bin/emacs "$@" Then ...
user avatar
  • 161
6 votes
Accepted

magit-push hangs on Windows

Magit's wiki now features a page about the various ways one can push from Magit when using MS Windows. Also checkout the new ssh-agency package. Both the wiki page and the package were written by @...
user avatar
  • 24.2k
6 votes

magit-push hangs on Windows

Usually, the problem is that Emacs can't access the password prompt of git on Windows. Thus, it seems to "hang" on push, where it really is waiting for your password. You can circumvent this by using ...
6 votes

Can Emacs use tramp to run in an interactive session on a remote HPC node?

I have been struggling to do the same. I found a different route that allowed me to do basically the same thing. You can open a shell buffer by M-x shell and from there connect to the login node, and ...
user avatar
6 votes
Accepted

Emacs suspend at startup ssh connection issue

Similar to Emacs bug#20015, this can be avoided by setting tramp-ssh-controlmaster-options before loading tramp. (setq tramp-ssh-controlmaster-options "-o ControlMaster=auto -o ControlPath='...
user avatar
  • 8,783
6 votes
Accepted

Magit doesn't recognise git repo through ssh connection

Error (magit): Magit requires Git >= 1.9.4, you are using 1.8.3. I've already installed git 2.10.0 on /usr/local/git The list of directories to search for executables on remote hosts is ...
user avatar
  • 24.2k
6 votes

fix or workaround: "Terminal is not fully functional"

If you don't care about whether Emacs is a "fully-functional" terminal or not and you just want it to work without making you press enter, then run the psql command \pset pager off. This ...
user avatar
  • 11.2k
5 votes
Accepted

How to sudo save file in TRAMP mode?

Have you tried the multi-hop method as suggested in the TRAMP manual? C-x C-f /ssh:user@localhost|sudo:localhost:/path/to/file RET
user avatar
  • 5,305
5 votes

Tramp: how to add (-A) agent forwarding to ssh connections?

After suggestions... (defun add-ssh-agent-to-tramp () (cl-pushnew '("-A") (cadr (assoc 'tramp-login-args ; if on Windows using Putty with Pageant, ...
user avatar
  • 958
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. ...
user avatar
5 votes
Accepted

How to make TRAMP aware of VPNs?

The answer to any engineering question that starts with “Can I have…” is almost always yes. The real question is how much work it will take, and whether it is worth it. You haven’t said what operating ...
user avatar
  • 11.2k
5 votes
Accepted

Emacs find-file over SSH is too slow to connect

Indeed, Tramp doesn't like your fancy prompt. The Tramp manual explains what to do, the FAQ section. In short, you shall add to your remote .profile [[ $TERM == "dumb" ]] &&...
user avatar
5 votes

Tramp mode - Copying files

You can use dired-async-do-copy from emacs-async to Run ‘dired-do-copy’ asynchronously.
user avatar
  • 1,096
4 votes

TRAMP vs ssh to remote emacs

A third variant is to mount the remote directories via sshfs and access them via your local Emacs. This has the advantage that you don't have to reproduce your Emacs setup on the remote machine(s) ...
user avatar
  • 279
4 votes
Accepted

Having trouble getting eshell remote shell multi-hop to work

The pipe | is special to the shell, try quoting the whole filename.
user avatar
  • 3,266

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