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 ...
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 ...
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 ...
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.
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"))
#+RESULTS[(2020-07-20 10:34:50) b20fc4ca99ae523b3497adaa26b8945c57b06254]:
: /home/stardiviner/Org/Wiki/Computer Technology/Programming/Emacs/Data/Emacs Packages/Org Mode/data/...
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 ...
Download and install iftop package, run a M-x term, then type something as:
$ iftop -i eth0 -f 'dst host 192.168.1.3'
-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.
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:
Move to the local root directory.
Move to the local home directory.
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
or customize tramp-completion-use-auth-sources:
tramp-completion-use-auth-sources is a ...
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 ...
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 ...
Emacs 26.3 knows connection-local variables. Your approach is OK. However, you must set the :user property explicitly, like
'(:application tramp :protocol "scp" :user "myname" :machine "my-linux-host")
$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.
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 22.214.171.124. Do you have installed it via the Emacs Package Manager?
If installed, there shall be a directory ~/.emacs.d/elpa/tramp-126.96.36.199. This shall be taken into account when starting Emacs. If not, you shall add this to the ...
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:
(setq tramp-archive-enabled nil))
However, there might be an error in the org exporter, because tramp-archive is activated only for a file ...
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.
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.
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 ...
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
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 /-:firstname.lastname@example.org:. 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 /...
The following is an excerpt from the Quick Start Guide for Tramp, which is built-in to Emacs 26:
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 ...
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
(let ((args (assoc 'tramp-login-args (assoc "ssh" tramp-methods))))
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 ...
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 ...
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 ...