Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Socket Programming Send password prompt from server to client for sudo cmd

807601Dec 18 2007 — edited Dec 20 2007
Hi,

Will the socket be able to send the password prompt from server to client.

I am doing a Client Server connection tool where in user enters the unix commands in the Client window, the commands get transferred to Server where it is executed. Normal unix commands are working fine. But whenever i give commands like sudo, passwd,login the password prompt appears in the Server side instead of client side.
What i did was i created a shell using runtime.getruntime.exec("sh");and then i passed the commands as outcommand.write(command);

If i give ls in the Client which sits in some unix box i will get list of all the files(users home dir) in the Server box. Nothing comes up in the Server program which is running in the Server side.

But i when wanted to execute sudo ps -ef, it requires password and this password appears in the Server side. I need to get this password prompt appearing in the Client side. Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 17 2008
Added on Dec 18 2007
4 comments
333 views