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?
-ton the ssh command and there are connection through. Now there are four. What are the mechanism that decides how many-tare necessary ? – Soren A May 03 '18 at 13:44-n? I'm thinking whether your question is possible duplicate of While loop only processes the first entry of ssh command (see also this)? – pa4080 May 04 '18 at 09:52