我一直收到此错误,并尝试了几种在线讨论的方法来解决此问题,但没有一种对我有用。我已经设置了SSH密钥,因此当我运行'ssh newton@host.com'
它时,它会自动登录我,我也将该用户设置visudo
为'newton ALL=(ALL:ALL) ALL'
,然后我也尝试添加'newton ALL=NOPASSWD: /var/www/script.sh'
不幸的是,每次我ssh newton@host.com 'sudo /var/www/script.sh'
从Cygwin 跑回来,我都会回来。我也尝试添加,-t -t
但是随后提示我输入密码。
total size is 21209180 speedup is 314.69
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: 3 incorrect password attempts
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: 3 incorrect password attempts
ssh example.com sudo echo hello
从一个Linux系统到另一个系统使用相同的问题。我已经相应地更新了您的标题。我也已标记您要迁移到Unix站点的问题。