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.

skippy10110
  • 145
  • 1
  • 4
  • 9

1 Answers1

1

Not an expert at this but you should probably use sudo instead of su. The following thread might help more pass-password-to-su-sudo-ssh

Community
  • 1
  • 1
osundblad
  • 2,675
  • 1
  • 29
  • 34