2

Is there any way to pass a password to the linux "su" command? I'm attempting to automate a deployment using sshexec and Ant. As part of that I need to execute the "su" command, but I can find no way to give it a password. The su command does not have the -S switch like sudo. I've tried using the commandResource and input properties on sshexec, but I just get an "su: Sorry" back.

Before anyone thinks I am, I am not storing passwords in files. The script to execute is being generated in memory in Ant based on prompting for a password.

4

1 に答える 1

1

これについては専門家ではありませんが、おそらく su の代わりに sudo を使用する必要があります。次のスレッドは、より多くのpass-password-to-su-sudo-ssh に役立つ可能性があります

于 2012-10-03T14:13:25.410 に答える