Skip to main content
Share Your Experience: Take the 2024 Developer Survey
18 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-...
tlegutko's user avatar
  • 356
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
15 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 ...
zck's user avatar
  • 9,102
14 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 ...
Tyler's user avatar
  • 22.3k
13 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 ...
tarsius's user avatar
  • 25.8k
11 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 ...
fr_andres's user avatar
  • 211
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 ...
Bounga's user avatar
  • 81
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 ...
tarsius's user avatar
  • 25.8k
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 ...
Joonha Park's user avatar
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 ...
db48x's user avatar
  • 18.2k
6 votes

Emacs 26.1 RC1 display issues over SSH/X11 with xming/vcxsrv

Emacs 26 by default switches on double buffering for X servers when it finds the Xdbe header on the build machine. (See Emacs 26 release notes at the GitHub mirror.) Some X servers don’t support this. ...
halloleo's user avatar
  • 1,345
6 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" ]] &&...
Michael Albinus's user avatar
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
5 votes

Magit how to use ssh key rather than being prompted for password

Edit ~/.ssh/config so that it contains the following: Host github.com IdentitiesOnly yes IdentityFile ~/.ssh/your_ssh_key Then whenever magit asks git to ask ssh to talk to github.com, ssh will ...
db48x's user avatar
  • 18.2k
5 votes
Accepted

tramp-default-method has no effect

With Tramp 2.3 / Emacs 26.1, Tramp's syntax has changed. It requires now the method name mandatory. If you want the shorter version of Tramp file names (without the method), you must change the syntax ...
Michael Albinus's 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 ...
db48x's user avatar
  • 18.2k
5 votes

Tramp mode - Copying files

You can use dired-async-do-copy from emacs-async to Run ‘dired-do-copy’ asynchronously.
Tianshu Wang's user avatar
  • 1,764
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) ...
loris's user avatar
  • 315
4 votes
Accepted

Tramp: Waiting for prompts from remote shell... Sending command `exec ssh -e none bin'

The message Sending command 'exec ssh -e none bin' is a clue that an error is occurring when exec-path-from-shell reads the path from the shell environment. Once I figured this out, I checked my ....
incandescentman's user avatar
4 votes

"Invalid base64 data" error when using tramp

The Edison didn't have some of the utilities tramp needs (base64, uuencode). Apparently tramp sends a perl script if it can't find them, but it did not work. It turns out that even when using ...
jpkotta's user avatar
  • 508
4 votes

Can't connect to remote ssh host using tramp on Windows

Try sshx command instead of ssh when opening with C-x C-f For more, search sshx at https://www.gnu.org/software/tramp/
Paul's user avatar
  • 191
4 votes

Magit how to use ssh key rather than being prompted for password

The issue was that the remote url was set to https rather than ssh following these steps fixed the issue https://help.github.com/articles/changing-a-remote-s-url/
irregular's user avatar
  • 1,022
4 votes
Accepted

How can Magit add a credential to ssh-agent?

You can use the ssh-agency package for this. It integrates with magit, and will run ssh-add as needed when you push. If you don't have ssh-askpass installed, you will need a version which includes ...
npostavs's user avatar
  • 9,203
4 votes
Accepted

Copy/paste between SSH terminal Emacs and macOS

I just recently wrote an Emacs package called Clipetty which solves this very problem. It uses OSC-52 xterm escape sequences, is smart enough to know when you're running on a remote host, and can deal ...
spud's user avatar
  • 121
4 votes
Accepted

emacs daemon and ssh agent forwarding

Both return the same value when getenv is called on SSH_AUTH_SOCK from within an emacs client. That looks unlikely. One would return ~/.ssh/ssh_auth_sock and the other would return /path/to/HOME/....
phils's user avatar
  • 51.5k
4 votes
Accepted

TRAMP mode hangs while copy large file from remote to local via Ssh

TRAMP uses itself Base64 encoding, it doesn't hangs, just takes a really long time for larger files. Maybe rsync or rcp methods speeds up the process, but this is its basis. What may be done is run ...
Borba88's user avatar
  • 156
4 votes
Accepted

Magit connecting to github with alternate ssh key

There's a pure Git solution you can use in your global .gitconfig - I use an include.path config for personal stuff by default: # .gitconfig # default user email and key [include] path = ....
jidicula's user avatar
  • 251
4 votes

how to execute sudo su --login username command with TRAMP

The variable tramp-methods keeps the arguments which Tramp uses for different methods. For sudo, there is the entry `("sudo" (tramp-login-program "env") (tramp-login-...
Michael Albinus's user avatar
3 votes
Accepted

connect to remote emacs session via ssh

Since this is running on X, it might be possible to use a program like xdotool , xdo, or wmctrl All these programs allow you to list windows, select one, and simulate typing on them. Another ...
icarus's user avatar
  • 1,914
3 votes

TRAMP hangs after timeout on trying to connect

Pls set (setq tramp-verbose 10) and rerun the test. There will be a debug buffer, which you shall show us. In case you don't want to show it publicly, send it to me via email.
Michael Albinus's user avatar

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