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