我正在尝试在远程服务器上使用sudo执行命令,类似于这样:
但服务器响应如下:
那么,我该如何使用Ant执行具有sudo权限的远程命令呢?
谢谢 :)
<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:
那么,我该如何使用Ant执行具有sudo权限的远程命令呢?
谢谢 :)