Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

how to provide password to sudo command

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 781
Netbeans IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
See my reply to https://coderanch.com/t/517209/java/java/provide-password-prompt-through-Java .
 
Marshal
Posts: 71730
312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

James Sabre wrote:See my reply to https://coderanch.com/t/517209/java/java/provide-password-prompt-through-Java .

Since you have already received an answer to the same question, I shall close this thread.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic