我很高兴运行Perl脚本,该脚本使用cygwin命令提示符下的Net :: SSH :: Expect包。但我想通过Windows 2003的任务计划或通过cygwin的crontab安排相同的脚本,或者从DOS命令提示符运行脚本在中间失败并出现以下错误。
错误:
SSHAuthenticationError Login timed out. The input stream currently has the conte
nts bellow: Pseudo-terminal will not be allocated because stdin is not a termina
l.
at /usr/lib/perl5/site_perl/5.10/Expect.pm line 828
密码:
任何身体都可以帮助我... 提前致谢。 基肖尔马布。
答案 0 :(得分:1)
您需要通过将-T
或-t
选项传递给SSH来强制或禁用在启动SSH的命令行中分配pseudy TTY。 From the SSH man page:
-T Disable pseudo-tty allocation.
-t Force pseudo-tty allocation. This can be used to execute arbi-
trary screen-based programs on a remote machine, which can be
very useful, e.g. when implementing menu services. Multiple -t
options force tty allocation, even if ssh has no local tty.