Changing Unix/Linux Password ( Please See The Java Code)
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   mazhar_saeed
Posted On:   Monday, February 4, 2002 06:45 AM

Hay! I am Using The Following Section of Code to change the Unix Password. and this code id not working properly Process ps = rt.exec("passwd userName"); InputStream input = ps.getInputStream(); BufferedReader inputReader = new BufferedReader(new InputStreamReader(input)); OutputStream output = ps.getOutputStream(); BufferedWriter outputWriter = new BufferedWriter ( new OutputStreamWriter(output)); outputWriter.write("password"); outputWriter.write("password"); But its not changing the password Thanx in Advance    More>>

Hay!

I am Using The Following Section of Code to change the Unix Password. and this code id not working properly




Process ps = rt.exec("passwd userName");


InputStream input = ps.getInputStream();


BufferedReader inputReader = new BufferedReader(new InputStreamReader(input));




OutputStream output = ps.getOutputStream();


BufferedWriter outputWriter = new BufferedWriter ( new OutputStreamWriter(output));




outputWriter.write("password");


outputWriter.write("password");




But its not changing the password

Thanx in Advance

   <<Less

Re: Changing Unix/Linux Password ( Please See The Java Code)

Posted By:   Stephan_Haller  
Posted On:   Thursday, February 7, 2002 12:34 PM

Hey!



First I must say, I'm not really good in programming in Java. Doing some footsteps by myself. But this topic interests me! :-)==)



I miss some information in your question: Can you see (errmmm... get) the result of your progress e.g. output stream? Do you executing your process as root?



Would like to hear if you solve this problem and how you did it!



Till then

Stephan
About | Sitemap | Contact