我使用一个小的programm = sshpass在脚本中使用ssh在linux路由器上执行命令
是否有替代sshpass,因为sshpass目前不正确(错误) – 与sshclient不兼容
这是它的替代scheme:
https://stackoverflow.com/questions/714915/using-the-passwd-command-from-within-a-shell-script
但从来没有推荐过,因为这是一个严重的安全弱点,可以引导你的系统向任何人开放。 最好设置无密码的sshlogin到你要运行特定命令的机器上。
它看起来不像任何人提到的期待: http : //linux.die.net/man/1/expect