[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Connect to the ssh and execute any command

From: Eduardo Ochs
Subject: Re: [O] Connect to the ssh and execute any command
Date: Thu, 12 Sep 2013 19:16:36 -0300

Hi Andrey,

you can use eev - take a look at the demo that starts at 0:18 in this
video here:


There are many things that I do in the server that hosts my home page
by using this to set up a connection,

  (eepitch-do "ssh address@hidden")

and then typing <f8> on each line that needs to be sent.

If you have any difficulty in setting things up feel free to get in
touch by e-mail, IRC (#eev at Freenode) or gmail chat - there are some
new features that do not appear in videos yet (the videos I have are a
few months old), and I am just resurecting my screencast-making
scripts to make some new ones... and I am exactly at the point where
tests and feedback can clarify a lot my ideas about the best ways to
present things.

  Cheers! =)
    Eduardo Ochs

On Thu, Sep 12, 2013 at 6:56 PM, Andrey Tykhonov <address@hidden> wrote:
Hi all!

During last several days I was trying to implement quite simple script

1. Creates new buffer with the shell (M-x shell)
2. Executes there "ssh address@hidden". As result -- the password
prompt appears in the minibuffer. I manually input password.
3. Then script executes any command in the recently created buffer
(shell), for example: "ls -la". So I expect to see directory listing on
the domain.com.

but, for sorry, I cannot to do so that "ls -la" will be executed!

I googled, I have tried many different approaches but without any luck :-(

Here I should mention quite important thing: I cannot use TRAMP because
it does not work with the server to which the script connects and then
on which executes "ls -la". (I suppose that TRAMP uses FUSE, but for
sorry FUSE does not work with mine server). So TRAMP is not available
for me.

For example I tried:

  (make-comint-in-buffer "ssh" "*ssh*" "ssh" nil "address@hidden")
  (make-comint-in-buffer "ls" "*ssh*" "ls" nil "-la")
"ls -la" does not executes.

  (make-comint-in-buffer "ssh" "*ssh*" "ssh" nil "address@hidden")
  ; instead of "ls -la" here is pwd
  (start-file-process "pwd" "*ssh*" "pwd")
In *scratch* outputs just "Process pwd finished"

  (start-process-shell-command "ssh" "*ssh*" "ssh address@hidden")
  (process-send-string (get-buffer-process "*ssh*") "pwd\n")
Seems this one -- is overall wrong approach because start-process-shell-command
does not want to show shell after I put the password in the prompt.

Also I tried call-process instead of start-process-shell-command:
(call-process "ssh" nil "*ssh*" t "address@hidden")

I got "Pseudo-terminal will not be allocated because stdin is not a


  (setq buffer (get-buffer-create "*ssh*"))
  ; switch to buffer
  (switch-to-buffer-other-window buffer)
  ; execute there a shell
  (shell buffer)
  ; then executes there mine commands
  (process-send-string (get-buffer-process "*ssh*") "ssh address@hidden")
  ; and
  (process-send-string (get-buffer-process "*ssh*") "ls -la")
Last process-send-string does not execute in time because it is not synchronous.
Last process-send-string does not wait for previous...

Also I tried set-process-filter but filter just eats password prompt so
I could not input password....

How my task could be implemented without TRAMP?

Please help!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]