aspose file tools*
The moose likes Linux / UNIX and the fly likes Connect to UNIX and execute commands from Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Connect to UNIX and execute commands from Java" Watch "Connect to UNIX and execute commands from Java" New topic
Author

Connect to UNIX and execute commands from Java

Pushpalatha Oleti
Greenhorn

Joined: Jan 30, 2012
Posts: 1
Hi,

I need to connect to unix and execute few commands to reset password of a user (on unix). I understand I cannot go with JSP to accomplish this and I have to use java code. In the link connect to unix , it is mentioned about enchanter jar. Could you please explain what enchanter jar is all about and how to connect to unix.

P.S: I am new to JavaRanch and Java, please excuse any mistakes.

Thanks,
Pushpa
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10535
    
    9

Welcome to the Ranch.
If I understood your question correctly, you wish to execute some command on a remote unix machine, using java. I am not sure if this is even possible.
However, i will move your topic to a more appropriate forum, and hopefully someone might be able to help you out.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Badal Chowdhary
Ranch Hand

Joined: Apr 26, 2011
Posts: 34

Check out JSch if that helps:
http://www.jcraft.com/jsch/


Blog: http://badalchowdhary.wordpress.com/
Twitter: http://twitter.com/badalrocks
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5845
    
    7

You could also use exec() to run ssh and pass the passwd command to it.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connect to UNIX and execute commands from Java