Balaji Soundarajan wrote:How to change the UNIX user using user ID in JAVA ?
Please give me any idea to implement this.
David Newton wrote:That's not the same thing.
Once you su you're that user until you exit the su shell.
sudo will run a given command on the command line and you'll be the original user when the command has completed.
Balaji Soundarajan wrote:I tried like p=Runtime.getRuntime().exec("su root") and its not executed.its working for all other commands like ls -a
Rob Prime wrote:If you're going to use Processes, search for and read the article "When Runtime.exec() won't" on JavaWorld.