Saturday 15 September 2012

busybox - ssh client (dropbear on a router) does no output when put in background -


I am trying to automate some things on remote Linux machines with bass scripting on Linux machine and a command ( Braces) is a belief from Cmd concatenations):

(ssh -i / path / to / private_key user @ remotehost 'sh -c' 'echo1; echo2; echo3; A '')

But if an ampersus is added to execute in the background, it seems that it executes, but E output is not printed, not on standout, and not on stadder, and even redirection of a file (inside the braces) does not work ...:

(Ssh -i / path / to / private_key user@remosthost 'sh -c' echo 1; echo2; echo3; -a "') and

Anyway, Running customer dropbear v0.52 in BusyBox v1.17.4 at 2.4.37.10 (Tomato build on WRT54G Tomato).

To get either output Is there any way? For this behavior Or reason?

Edit:

To facilitate, plain ssh help output here (on my tomatoes use):

  dropback client v0.52 usage: ssh [options] [user @] host [/ port] [, [user]] host / port] ... [command] options are: -P & LT; Remote Port & gt; -l & lt; Username & gt; -t is not allocated a pty -t do not allocate a pty-n Do not run a remote command- run auth-auth- in the background -y always accept the remote host key to the unknown-s request a subsystem (for sftp Use) -i & lt; Identityfile & gt; (Multiple allowed) -L & L; Masters: RemoteHost: RemotePort & gt; Local Port Forwarding- Forward Hosts Forwarded Port-R & Lt; Allow to contact: remotehost: remoteport & gt; Remote Port Forwarding - W & lt; Receive_window_buffer & gt; (Default is 12288, can be fast, maximum 1 MB) -s & lt; Diced & gt; (0 is never the default, too) - I & lt; Idle_timeout & gt; (0 anytime, is not the default) -b & lt; EndHost: Endport & gt; NetKat-like forwarding - J & lt; Proxy_Program & gt; Use program pipe instead of TCP connection   

Revision after 1 day:

The same result will not hurt with the braces and without it. I wanted to do ssh authentication on the background, so the -f option is not a solution. Interesting side note: If an unexpected option is specified (such as -v ), error Message: WARNING: Ignoring unknown logic - 'v' is displayed - even when put in the background, so getting output from background processes usually works in my environment .

I tried x86 Ubuntu on the regular ssh client: it works I also tried the dbclient on x86 Ubuntu: works too So this problem is specific for the tomato build - or there was an unknown fix between the "DropBatter v0.52" built in tomatoes and between a Ubuntu (the difference in support output only gets double-sized default window buffer at Ubuntu) How can one process know how this surface Was kept in Mi? Is there a solution to the problem?

I had a similar problem for my OpenWRT router Dropbear SSH client output for something Does not even write if there is no stdin, e.g. When run by Cron I think & amp; The process has the same effect on stdin (no input).

I found some solution on author's bug tracker / try to redirect the input from dev / zero:

  ssh -i yourkey user @ remotehost "123 Echo "& lt; / Dev / zero & amp;   

This works for me as I tried to describe.

No comments:

Post a Comment