Pseudo-tty allocation and -T option

John Horne J.Horne at plymouth.ac.uk
Thu Nov 30 02:23:00 EST 2000


Hello,

I've set up a cron job to use ssh with a remote forced command to delete the
contents of a directory. System A has the cron job and uses a specific key
for system B. No command as such is specified since the key on system B
specifies 'command=/bin/rm -rf ...'. However, I am getting error messages
back from the cron system (or rather from ssh) about it not allocating a tty
since there is no controlling terminal - obviously not since the job is run
through cron:

  Pseudo-terminal will not be allocated because stdin is not a terminal.

I have tried using the -T option and specifying no_pty in the
key options on system B, but I still get the error message. The man page for
ssh says:
 
     -T      Disable pseudo-tty allocation (protocol version 2 only).

We are only using protocol 2; openssh 2.3.0p1. So is '-T' not working
correctly, am I doing something wrong or is openssh correct in that it will
always print out the message if used via cron? If the latter then how can I
'remove' the message since the output gets mailed back to the user (in this
case the postmasters). I have thought about using:

    ssh .... 2>&1 | egrep -v "^Pseudo-terminal will not be"

which seems to work but seems a bit messy. Using '-q' to ssh makes no
difference either. My understanding from the man page is that -T should
prevent it attempting to allocate a tty.

Thanks for any help,

John.

------------------------------------------------------------------------
John Horne, University of Plymouth, UK           Tel: +44 (0)1752 233914
E-mail: jhorne at plymouth.ac.uk
PGP key available from public key servers





More information about the openssh-unix-dev mailing list