【发布时间】:2012-11-19 04:49:07
【问题描述】:
可能重复:
pass password to su/sudo/ssh
SSH in shell scipt with password
有没有可能我可以为 ssh 命令传递密码
ssh root@10.20.30.40 | echo "Password" (or)
echo "Password" | ssh root@10.20.30.40 (or) a script like below
pw1="Password"
ssh -t root@168.56.64.245 <<< EOF
$pw1
EOF
任何解决方案都会有所帮助。
我在 Windows 上,我正在使用 putty 连接到 Linux 主机,然后从该 Linux 连接到另一台 Linux 主机。问题是我无法在 Linux 主机上使用任何 3rd 方工具,也无法添加 rsa-keys。
【问题讨论】:
-
我无法使用 Expect 之类的工具。
-
另外两个 Linux 版本都是 SUSE 11 Sp2
-
避免这样做。使用公钥,并适当配置您的
ssh。
标签: linux bash shell ssh passwords