Stephen Meatheringham, on July 4. 2000, wrote:
  : I have just upgraded from ssh 1.something to 2.2.0 on my Sun unix machines 
  : (Solaris 7).  I have a script which runs by hand with no worries, however, it 
  : gives me errors when run via cron - simply because I don't have a tty attached.
  : 
  : For example, doing "ssh user@remote host /bin/w -u"  gives the output as:
  : You have no controlling terminal.Can't initialize readline for confirmations.
  :  11:08am  up 15 day(s),  2:24,  5 users,  load average: 0.26, 0.12, 0.08
  : 
  : The error is coming from ssh2.c where it tries to open /dev/tty and fails.
  : Looking at the ssh man pages I thought adding a "-t" would allocate a tty.
  : But no luck there.  Apart from hacking the source code to comment out that test 
  : does anyone have any suggestions?

Try to give the ssh2 the '-o "BatchMode yes"' commandline
parameter. This should disable all tty-checking.

Like this:
% ssh -o "BatchMode yes" user@remote host /bin/w -u

Regards,
-- 
[[EMAIL PROTECTED]          --  Sami J. Lehtinen  --           [EMAIL PROTECTED]]
[work:+358 9 85657425][gsm:+358 50 5170 258][http://www.iki.fi/~sjl]
[SSH Communications Security Corp               http://www.ssh.com/]

Reply via email to