0

CentOS 7, Emacs 27.1

Here content of file myFile.sh:

ssh [email protected]

So when in vterm mode I use this:

./myFile.sh

then I success connect to the remote machine (ip = 10.111.11.111) by Tramp mode.

Nice.

Now I want to run myFile.sh in dired mode. Here folder with myFile.sh in dired mode.

enter image description here

So I try

! (dired-do-shell-command) 

As result in the minibuffer show.

enter image description here

Then in the minibuffer I input

./myFile.sh

and press Enter.

But I get error:

Pseudo-terminal will not be allocated because stdin is not a terminal.
ssh_askpass: exec(/usr/libexec/openssh/ssh-askpass): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(/usr/libexec/openssh/ssh-askpass): No such file or directory
Permission denied, please try again.
ssh_askpass: exec(/usr/libexec/openssh/ssh-askpass): No such file or directory
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

enter image description here

2
  • Executing ./myfile.sh from a vterm does not mean you are using Tramp to connect to the remote: all it means is that you have an ssh connection to the remote, the same as if you were doing it in a terminal outside of emacs. If you want to open a Tramp connection, then just do C-x C-f /scp:[email protected]: or something similar.
    – NickD
    May 19, 2021 at 15:13
  • @NickD I know about Tramp connection. But I want run my bash file in dired mode (by "! (dired-do-shell-command)") . Is it possible? May 19, 2021 at 15:46

1 Answer 1

0

You must add the arguments "-t -t" to your ssh call (yes, "-t" twice).

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.