windows2003中任务调度程序与ssh连接
环境与任务:我已经在 machine1(2003) 的 user1 和 machine2(HP-UX) 机器的 user2 之间配置了 ssh 无密码身份验证(通过交换公钥),之后我在 perl 脚本中使用该 ssh 连接来执行 ssh 命令在机器2上。
问题:当我从 machine1 手动执行脚本时,它不会询问 machine2 的 user2 的任何密码,如果我通过 windows2003 的任务调度程序执行相同的操作,它会询问 machine2 的 user2 的密码。 任何人都可以帮助我了解原因..
提前致谢, 基肖尔。
Environment & Task: I have configured the ssh password less authentication(by exchanging public key) between user1 of machine1(2003) and user2 of machine2(HP-UX) machine after words I am using that ssh connection in the perl script to execute the ssh command at machine2.
Issue: When ever i am manually executing the script from machine1 it is not asking any password for user2 of machine2, If i execute the same throught the task shedular of windows2003 it is asking the password of user2 of machine2.
can any body help me out in knowing the reason..
Thanks in advance,
kishore.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一场噩梦。
我终于发现你需要设置 HOMEDRIVE 和 HOMEPATH 环境变量。在交互式运行和任务计划程序中使用命令“set”打印出环境变量并比较输出,这是任务计划程序中唯一不存在的两个环境变量,感谢上帝,它们起作用了。设置完这些后,任务调度程序终于可以看到已知的主机,
如果您想使用 scp 将文件复制到 Windows 计算机,那么在通过任务调度程序运行时您可能会遇到另一个令人愉快的问题:由于某种原因 scp 无法复制到任何旧的主机文件夹,它必须是登录用户的主文件夹。好吧,也许它并没有那么严格,但老实说,当我完成 6 个小时的废话时,我实在懒得去发现。无论如何,解决方法是首先将文件 scp 到登录用户的主文件夹中,然后将它们移动到最终目的地。
这是我的批处理文件的最终结果(从最终目标目录内部运行):
我希望有一天这可以帮助一些可怜的灵魂。
This was a nightmare.
I finally figured out that you need to set the HOMEDRIVE and HOMEPATH environment variables. Using the command 'set' to print out the environment variables when running interactive and with task scheduler and comparing the output, these were the only two that were not present with task scheduler and thank God they worked. After setting these, the task scheduler could finally see the known hosts,
If you want to use scp to copy files to the windows machine you will probably come across another delightful problem when running via task scheduler: for some reason scp cannot copy to any old folder, it must be the home folder of the logged in user. Well maybe it's not quite as restrictive as that but I honestly could not be bothered finding out by the time I was done with 6 hours of this nonsense. Anyway, the workaround is to first scp the files to the logged in user's home folder, then move them to the final destination after that.
Here is how my batch file ended up (run from inside the final destination directory):
I hope this helps some poor soul out there someday.