从 DOS CMD 在 cygwin 环境中使用 Net::SSH::Expect 包运行 perl 脚本

发布于 2024-12-01 02:33:38 字数 445 浏览 0 评论 0原文

我成功地从 cygwin 命令提示符运行使用 Net::SSH::Expect 包的 Perl 脚本。但我想通过 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

密码:

任何人都可以帮我解决这个问题吗? 提前致谢。 基肖尔。

I am sucessed to run the Perl script which uses Net::SSH::Expect package from the cygwin command prompt. but i want to schedule the same script through the task schedular of windows 2003 or throught the crontab of cygwin or to run from DOS command prompt the script is failing in middle with below error.

Error:

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

Password:

can any body help me out in this..
Thanks in advance.
kishore.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

生生漫 2024-12-08 02:33:38

您需要通过将 -T-t 选项传递给 SSH,在启动 SSH 的命令行中强制或禁用伪 TTY 的分配。 来自 SSH 手册页

 -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.

You need to either force or disable the allocation of the pseudy TTY in your command line which launches SSH, by passing the -T or -t option to SSH. 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.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文