Win a copy of The Java Performance Companion this week in the Performance forum!
    Bookmark Topic Watch Topic
  • New Topic

how to provide password to sudo command

 
jaibhim max
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
See my reply to http://www.coderanch.com/t/517209/java/java/provide-password-prompt-through-Java .
 
Campbell Ritchie
Sheriff
Pie
Posts: 49466
64
  • Mark post as helpful
  • send pies
  • Report post to moderator
Since you have already received an answer to the same question, I shall close this thread.
 
    Bookmark Topic Watch Topic
  • New Topic