In message <[EMAIL PROTECTED]
tec.com>, "Wood, Jeremy" writes:

> All:
>       I have written a script that uses rsync via ssh to connect to
> another server I have web content on.  The script runs fine when I run it
> from a command line, but when it is run from cron, the ssh hostbased
> authentication that I am using cannot work because it is giving me errors.
> Bascially since there is not tty allocated and no display named, it (ssh)
> cannot authenticat and therefore burns the whole darn thing.   Any ideas on
> what I could do to fix it?  I have run out of ideas.

I ran into the same problem with this version of ssh on solaris 2.6:
ssh2: SSH Secure Shell 2.1.0 (non-commercial version)

This is what I had to do in my script to make the shell happy:

# we have to do this kludge with a subshell to prevent ssh2
# from blocking on stdin or stdout (despite the -n flag)
( echo ssh2 -n -x -a -l $mirror_user $mirror_host "$@"
  ssh2 -n -x -a -l $mirror_user $mirror_host "$@" </dev/zero 2>&1 \
) |    /bin/cat -u

The only minor annoyance is that I still get a warning about no
controlling terminal from the ssh2 process.


-- Alberto



****************************************************************************
Alberto Accomazzi                          mailto:[EMAIL PROTECTED]
NASA Astrophysics Data System                      http://adsabs.harvard.edu
Harvard-Smithsonian Center for Astrophysics        http://cfawww.harvard.edu
60 Garden Street, MS 83, Cambridge, MA 02138 USA   
****************************************************************************

Reply via email to