I have a problem running a ssh from crontab against a Fujitsu DX200 storage appliance.
When running the command from terminal everything works okay connecting using RSA keys, but when I embed the command in a script and run it from cron it fails with "Pseudo-terminal will not be allocated because stdin is not a terminal."
The command is ssh user@dx200 "show performance -type host-io"
According to many articles on the net, adding a number of -t
as an argument to ssh it should force allocating PTY. On RedHat, where the script was developed, it works by adding -t -t -t
(or -ttt
) but that's not the case when running on Ubuntu.
Using ssh -T (Disable pseudo-tty allocation) makes the login to dx200 fail with "FUJITSU Storage ETERNUS login is required..." - that is, not logging in whit RSA key.
Other solutions from the net, using variants of ssh ... /bin/bash <<EOF ...
is not possible because we cant launch a shell on the storage appliance.
Any ideas on how to circumvent this issue?
Answering my own question ...
Adding an extra
-t
argument to ssh solved the problem.The command now looks like
ssh -t -t -t -t user@dx200 ......
(-tttt
should do the same).The man page on ssh say's this about -t:
But nothing about how many 'Multiple' is, or what in the ssh code that governs the number of
-t
options required.