3
我试图在远程服务器上执行命令使用sudo这样如何执行sudo命令与蚂蚁sshexec
<target name="remote-test">
<sshexec host="${remote.host}"
username="${remote.user}"
password="${remote.pass}"
trust="true"
usepty="true"
command="sudo ls /home/myuser" />
</target>
但是服务器响应如下:
Buildfile: build.xml
remote-test:
[sshexec] Connecting to 0.0.0.0:22
[sshexec] cmd : sudo ls /home/myuser
[sshexec] [sudo] password for myuser:
所以,我如何使用蚂蚁来执行远程命令与sudo?
谢谢:)
可能的重复[将密码传递给“su”命令通过ant从sshexec](http://stackoverflow.com/questions/10919381/passing-a-password-to-su-command-over-sshexec-from -蚂蚁) – 2014-11-21 21:41:10