Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Secure-Shell
[Top] [All Lists]

Re: Running ssh cmd on cron -- debug2: channel 0: read failed

Subject: Re: Running ssh cmd on cron -- debug2: channel 0: read failed
Date: Wed, 11 Jan 2006 21:42:12 +1100
On Wed, Jan 04, 2006 at 01:55:04PM -0800, Joe Park wrote:
I've been trying to run some commands on remote machine over ssh as a
cron job.  It works fine if I manually run it on command line but it
does not run right if I run it as a cron job.  I get 0 exit status which
is strange.  I found "debug2: channel 0: read failed" message when I ran
it with -vvv options.  [...]

You don't happen to have 2 copies of ssh installed in separate paths,
do you?  cron's environment is usually a lot more limited that an
interactive shell's so you might be running different ssh binaries...

If it's not that then I'm not sure what's going on but I have a couple
of things you might like to try: run the ssh command in a nohup and
see if it makes a difference, and try redirecting stdin, stdout to/from
/dev/null on both the client and server (separately).

The other thing: try using adding "-t" to the ssh command line to
allocate a pty on the server side (it's a long shot and not a real
solution, though).

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

<Prev in Thread] Current Thread [Next in Thread>