Configuring unix machines via web using Java and/or Perl

Posted on 2007-08-08
Last Modified: 2013-11-05
I am working on a website designed to remotely connect to different unix boxes (ssh) and perform different command line tasks.

What does Java give us regarding connecting, processing command line args, etc.  Does Java offer anything similar to Expect scripting?

What is the best way (preferably Java, but we can do Perl too) to:

1) Get user login credentials via web and remotely connect (ssh) to the boxes.
2) Process CLI commands from Java app (servlet)

Question by:krussell222
    LVL 15

    Accepted Solution

    I'm a bit confused as to what you're looking to accomplish.  It almost sounds like ssh through a website?  If so, there are plenty of ssh applets out there.

    I presume you're aware of Webmin.  It's a fairly robust browser based remote administration tool:


    Author Comment

    Basically that is pretty much it.  

    I need a way to do identical configuration of apps over a series of boxes (dozens) without the need to log into each box and run the config (which is run via a series of CLI commands).  The closest example would probably be adding an identical firewall rule to 10 different firewalls running on 10 different boxes.  I'll check out webmin and see if it offers what I'm looking for.

    Author Comment

    I guess I should add... this needs to happen without user interaction.  Basically I'll upload a file with the CLI commands and submit it.  Then I want my web app to login in to each server and run the commands.
    LVL 39

    Expert Comment

    This sounds like it could be done with perl
    If you want a web-based interface, you can use the CGI module.
    To SSH to a bunch of machines, you can use the Net::SSH module.

    Author Comment

    Yeah.. I am leaning toward Perl.  However, I don't think I'll be able to use Net::SSH since it requires using DSA/RSA keys and that isn't an option on these boxes.
    LVL 39

    Assisted Solution

    One of the other Net::SSH::* modules might work.
    LVL 86

    Assisted Solution

    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Title # Comments Views Activity
    hasOne  challenge 59 64
    bunnyEars challenge 6 45
    mapBully challenge 6 53
    solarwind tftp server 2 18
    Using Quotation Marks in PHP This question ( seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now