# test.sh
sudo apt update
ssh root@server_ip "bash" < ./test.sh
报错sudo: no tty present and no askpass program specified
我把命令改成
ssh -t root@server_ip "bash" < ./test.sh
报错Pseudo-terminal will not be allocated because stdin is not a terminal.
我再把命令改成
ssh -tt root@server_ip "bash" < ./test.sh
不报错,也可以输入密码,但是密码是明文的,而且输入密码后没有反应。
求解决。