Having issues with remote command execution - ssh -t host 'sudo command'
Merto Mertek
masmertoz at gmail.com
Thu Feb 9 10:11:02 EST 2012
I've been trying to find an answer on other sites however I could not
resolve my problem.
spec:
os: ubuntu 10.0, OpenSSH_5.5p1 Debian-4ubuntu4, OpenSSL 0.9.8o
problem:
When trying to restart deamons on remote pcs having the same specs,
sometimes deamons are executed succesfully and sometimes not. I am using
the following command:
ssh -t -vvv "$host" 'sudo /usr/local/sbin/program'
which asks me for a pass and then continues. From the debug log I can see
that the difference from a successfull and unsuscesful run depends on
sequence of the following code blocks. If successful first runs code block1
and then block2, otherwise the opposite.
code1:
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: channel 0: close_write
debug2: channel 0: output drain -> closed
code2:
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow at openssh.com reply 0
debug2: channel 0: rcvd eow
debug2: channel 0: close_read
debug2: channel 0: input open -> closed
Any help appreciated..
thanks
More information about the openssh-unix-dev
mailing list