Hot answers tagged

4

Use TRAMP multi-hop syntax for :dir header. 4.4 Combining ssh or plink with su or sudo If the su or sudo option shall be performed on another host, it could be comnbined with a leading ssh or plink option. That means, TRAMP connects first to the other host with non-administrative credentials, and changes to administrative credentials on that host ...


3

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) and you can use your local software, such as Git, which might be more up-to-date than on the remote machines. This approach is, however, not perfect. Problems ...


3

I've written the following snippet which (as far as I can tell) does what you're looking for from the point of view of the ! command. It does the following: Takes the files that would have operated on by dired-do-shell-command (i.e. the ! key). This will be either the marked files, the file under point if nothing is marked or the files specified by a ...


3

Your command cd /ssh:desktop:/home/user/project/Release && make will be given to a shell on the remote machine. This doesn't know any Tramp syntax, and it runs already on the proper host. So you shall use the command cd /home/user/project/Release && make instead.


2

I suddenly come up with string concat idea. Here is the very simple solution. #+begin_src sh :dir (concat "/sudo::" (expand-file-name "data/code")) pwd #+end_src #+RESULTS[(2020-07-20 10:34:50) b20fc4ca99ae523b3497adaa26b8945c57b06254]: : /home/stardiviner/Org/Wiki/Computer Technology/Programming/Emacs/Data/Emacs Packages/Org Mode/data/...


2

Just do it as brother up there said, we are having similar problem here and CRTL + g works swiftly, then just check debug buffer.


2

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 a shell command in minibuffer, via M-!, then enter scp as outside of Emacs, and without using TRAMP mode, it would accelerate it significantly, with regular scp ...


2

Download and install iftop package, run a M-x term, then type something as: $ iftop -i eth0 -f 'dst host 192.168.1.3' As for: -i local interface -f filter code, as in pcap-filter man page, for destination host in the example. There will be 3 speed rates in inferior right part of the screen, meaning that for 2, 10 and 40 seconds respectively.


2

Is there a way to do this in a more natural fashion? The best way I know is to type ~ twice: the first time will restart completion from your remote home directory, and the second from your local home directory. Quoth (ivy) Using TRAMP: ‘/ C-j’ Move to the local root directory. ‘~~’ Move to the local home directory.


2

You can either use this (I base mine on the command-line arguments): (setq tzz-gnus-running-p (member "gnus" command-line-args)) (setq auth-sources (if tzz-gnus-running-p '("~/.gnus.json.gpg") '("~/.authinfo.json.gpg"))) or customize tramp-completion-use-auth-sources: tramp-completion-use-auth-sources is a ...


2

sftp is implemented in Tramp by GVFS, so it doesn't support remote processes. You must use a Tramp method like ssh or scp.


2

sftp is implemented in Tramp by GVFS, so it doesn't support remote processes. You must use a Tramp method like ssh or scp.


2

You'll be happy to learn that in more recent tramp releases (first included in Emacs 27.1) the :: case will work the way you want it to, such that /ssh:you@remotehost|sudo:: will re-use remotehost rather than your own local hostname, so you won't end up with a bad proxy entry. In addition, the likes of /ssh:you@remotehost|sudo:localhost: are detected and ...


2

The command /usr/bin/ssh -o ControlPath=%C 0.0.0.1 is used to check, whether your local ssh command accepts the ControlPath option. 0.0.0.1 is a non-existing address; ssh shall return immediately with an error. In more recent Tramp versions, the blocking is avoided by using the command ssh -o ConnectTimeout=1 -o ControlPath=%C 0.0.0.1. I recommend to upgrade ...


1

Emacs 26.3 knows connection-local variables. Your approach is OK. However, you must set the :user property explicitly, like (connection-local-set-profiles '(:application tramp :protocol "scp" :user "myname" :machine "my-linux-host") 'remote-bash)


1

$INSIDE_EMACS is set when the remote shell is called explicitly. However, this is not given when your login shell is called, due to the ssh command. Therefore, if you have bash as login shell, that variable is not set yet at this time.


1

Yes, Tramp 2.4.3 works with Emacs 25. It is not distributed via MELPA (to my knowledge), but via GNU ELPA. The recent version there is 2.4.3.3. Do you have installed it via the Emacs Package Manager? If installed, there shall be a directory ~/.emacs.d/elpa/tramp-2.4.3.3. This shall be taken into account when starting Emacs. If not, you shall add this to the ...


1

You are hit by the new tramp-archive.el package, which regards *.odt files as an archive (like *.tar files). In order to disable this, you might add the following to your ~/.emacs: (with-eval-after-load 'tramp-archive (setq tramp-archive-enabled nil)) However, there might be an error in the org exporter, because tramp-archive is activated only for a file ...


1

Completely untested: (add-hook 'c++-mode-hook (lambda () (when (file-remote-p default-directory) (company-mode -1))))


1

M-x shell runs always a new shell asynchronously, which means a new connection. If you just need to run a command on the remote host, consider shell-command. Something like (shell-command "hostname") is an example for this.


1

Invoking M-x shell from a buffer with a remote file name should start a shell on the remote host. The same thing applies to most commands which start a process. how can i drop to a shell after i'm done finishing editing my conf file? It sounds like you simply need to use M-x shell in that conf file's buffer.


1

This is not possible as of today. Patches welcome!


1

Using the temporary test AWS account, I have been able to access that file system via Tramp. Necessary configs are If you use another AWS profile but default, you shall tell it to Emacs. Add to your ~/.emacs (setenv "AWS_PROFILE" "my_profile") Add your private key file to ~/.ssh/config Host i-* mi-* ProxyCommand sh -c "aws ssm start-session --target ...


1

I've never heard of CyberArk Privileged Session Manager, but from your description adding it to tramp-methods shouldn't be too hard. The simplest way is probably to add an entry with (add-to-list 'tramp-methods ("psm" (tramp-login-program "ssh") (tramp-login-args (("-l" "username") ...


1

As other answers have mentioned already, Tramp has strengthened its syntax. It requires a mandatory method name now. You could use - as method name if you mean the default method, like in /-:myuname@myserver.com:. If you don't what to apply any other method name but the default one, apply (tramp-change-syntax 'simplified). This changes Tramp syntax to /...


1

The following is an excerpt from the Quick Start Guide for Tramp, which is built-in to Emacs 26: https://www.gnu.org/software/emacs/manual/html_node/tramp/Quick-Start-Guide.html Tramp extends the Emacs file name syntax by a remote component. A remote file name looks always like /method:user@host:/path/to/file. You can use remote files exactly like ...


1

If you mean to use this config file in Tramp instead of ~/.ssh/config, you need to tell Tramp so in tramp-methods. Something like (progn (require 'tramp-sh) (let ((args (assoc 'tramp-login-args (assoc "ssh" tramp-methods)))) (setcar (cdr args) (append '(("-F" "/home/alamd/ПакетыДоступа/root_91_211_249_142/config")) (cadr ...


1

Use elisp in the :dir header to fetch the value the :HEADER-ARGS:bash from the PROPERTIES drawer, remove original :dir string and return new value with a subdirectory appended. For example, to append the todolist1, subdirectory, set the header below on the bash code block. :dir (format "%s/todolist1" (replace-regexp-in-string ":dir +" "" (org-entry-get ...


1

The recent Tramp versions support the nextcloud method, which is also good for OwnCloud servers. You might have better Tramp support if you use the latest Tramp (via GNU ELPA), create on your local machine a NextCloud GNOME Account, and try it. If there are further problems on the Tramp side, I might be able to help; I have configured several OwnCloud and ...


1

I made this work by passing argument when launching gdb. M-x gdb RET gdb -i=mi -ex "target extended-remote <remote>:44421" -ex "set remote exec-file ./executable" --args "-c config.xml" Then in gdb launched i also had to set set non-stop off. I ran gdbserver as gdbserver --multi :44421 in the folder on remote where executable was. It worked. But ...


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