File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes how to provide password to sudo command Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

how to provide password to sudo command

jaibhim max
Greenhorn

Joined: Nov 15, 2010
Posts: 21
Hi,

I am creating an application that requires "sudo" permissions to execute. So, if I try to execute mount command then I need to run following command.

To run the above command, I need to run it in java code as -

In the above case, sudo asks for sudo password at the terminal. How should I write the java code that will allow me to provide sudo password.

Please help me out because its too urgent
James Sabre
Ranch Hand

Joined: Sep 07, 2004
Posts: 781

See my reply to http://www.coderanch.com/t/517209/java/java/provide-password-prompt-through-Java .


Retired horse trader.
 Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36453
    
  15
Since you have already received an answer to the same question, I shall close this thread.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to provide password to sudo command
 
Similar Threads
Opinions on Ubuntu
RPM files in Suse
Trying to run a program in linux from java
How to provide password to the prompt through Java
External HDD in Linux