例如连接 ssh,需要输入密码。如何用 shell 或者 c 完成输入密码的操作?
1
ruanimal Sep 25, 2020
写 except 脚本吧
|
2
sabermiao Sep 25, 2020 可以装个 sshpass
sshpass -p "password" ssh user@host |
3
alldoprogramer OP @sabermiao 我交叉编译后在设备上使用 sshpass,会卡在连接成功那里,然后后面就不能操作了
|
4
alldoprogramer OP @ruanimal 所以用 C 是做不到的吗
|
5
julyclyde Sep 30, 2020
输入密码一般是对应 tty 而不是 stdin
|