How I can connect my java application to unix server

I want to develop simple desktop Application using which I can login and fire simple UNIX command like ls -lrt etc. Can any one guide me to achieve this ?

Here is a sample program which illustrates connecting to a unix server using SSH protocol.
The API used is enchanter - http://code.google.com/p/enchanter/
import java.io.IOException;
import org.twdata.enchanter.SSH;
import org.twdata.enchanter.impl.DefaultSSH;
public class MainSSH {
      * @param args
      * @throws IOException
     public static void main(String[] args) throws IOException {
          SSH ssh = new DefaultSSH();
          ssh.connect("<IP_Address>", 22<port_number>, "<user_name>", "<password>");
          ssh.waitFor("]$");
          ssh.sendLine("ls -lrt");          
          System.out.println(ssh.getLine());
          ssh.disconnect();
}Thanks,
Avin

Similar Messages

  • How to use Entrust with java application on unix platform

    Hi all,
    i have question regarding the use of Entrust with java application on unix
    1)I want to use Entrust for encryption/decryption of the file in my core java application on unix platform.
    What should be requiremnet for the same and how it is implemented?.
    2) I want to Use Entrust for Authentication purpose in my java based web application on unix platform.
    What are requirements for Entrust Authentication and how it is implemented ?

    any one has solution?

  • How to deploy a normal Java application onto Sun Server

    Hi
    How do you deploy a normal Java application onto the Sun server...what are the required config files one needs to set etc

    You might want to start with the Java EE 5 tutorial, available here :
    http://java.sun.com/javaee/5/docs/tutorial/doc/
    --ken                                                                                                                                                                                                                                                           

  • How to invoce remote none-java application in Portal Server

    Hi all
    We have a project that try to use SUN portal server to call remote coldfusion application, according to the server guide I just find the remote portlet can be invocate. Any one had the experience on that.
    Thanks
    Rosso

    The iFrame Provider is provided out of the box with the Sun Portal. You can just use psconsole to add a new channel to a tab. Select "Provider" for the type and then select iFrame for the Provider. You can enter a URL property that points to site you want to appear in the iFrame. There are other useful properties that control scrolling behavior and the height/width of the channel.
    - Jim

  • How java application can access other java application

    Hi everyone,
    Please help me, I need to know how I can make my java program,
    specifically a servlet, access other java application continuously running a single instance in java virtual machine, and vice-versa.
    thanks in advance

    A java application is just a bunch of classes with one designated as a main class. You can simply ensure the classes are available to the server's jvm and then load and run the "external" program as part of the servlet process.
    If you have full access, and which external program is to be run, you can simply import it in your source.
    If your don't have the details at run time use the java.reflect.* stuff to load and run the class dynamically.

  • How do I run java application on IIS server

    Hi,
    Can I run java application on IIS(Internet information Server)?
    If yes, How do i do that?
    My java application contains JSP,Servlets and EJB.
    To run java application on IIS which plug in should i use.
    Can anybody help me This is urgent...........
    Thanx

    Hi
    Check this article on JGuru. It explains how to use Tomcat together with IIS.
    http://www.jguru.com/faq/view.jsp?EID=776546
    If you also need to use EJB's you probably also want to have a JBoss installed - check www.jboss.org
    /Peter

  • How to send attachments using java application and outlook

    Hi ,
    I created an application in java which is as
    on the Conference Tab i can schedule a conference and with the send command on page it map all the scheduled data to outlook(with all conference details) and using outlook send option the mails are send to appropriate user.
    but now i want to modify this application such as when i use the send command from my jsp page it should attach the file that is in .vcs or .ics format for auto updation of user calender.
    can any one know how to send attachment using java application .

    Last time I checked, SMS was a service between carriers and doing SMS yourself was really tricky. Some services existed to let you do it but as I recall they wanted non-trivial money.
    However, most phone carriers provide an email-to-SMS bridge of some kind.
    So the easiest thing is just to send an email.
    That's sending from a non-phone to a phone. There's a J2ME library to send/receive SMS from/to a phone.
    However, this is from memory, and a little out of date, so I could be entirely wrong. Hope it helps anyway.

  • How to establish a connection from java to SAP Netwevare server

    Hi All,
    As per my requirement i need to create a connection from Java to SAP Netwevaer Server inorder to access the docs from KM. PLZ provide some sample code
    (I know how to connect from java to SAP R/3 syatem using JCo connector).
    Can anybody help me.
    ADV Thanks

    Look
    https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/6615ea90-0201-0010-be81-e7a300fdf212
    /people/rohit.radhakrishnan/blog/2005/05/27/uploading-files-to-km-repository-using-webdynpro-apis

  • I created new RAC DB, how i can connect to sql?

    export ORACLE_SID=testtest.test.com - esm01p:/opt/oracle
    set $ORACLE_HOME=/opt/oracle/10.2.0.1.0ricsflgrd401.ric.infineon.com - esm01p:/opt/oracle
    sqlplus /nologSQL*Plus: Release 10.2.0.1.0 - Production on Tue Oct 31 11:36:31 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    SQL> connect /as sysdba;
    Connected to an idle instance.
    I created new RAC DB, how i can connect to sql?

    Instead of the database name, try the instance name with number.
    -bash-3.00$ crsstat
    HA Resource Target State
    ora.racdev.db ONLINE ONLINE on tstorarac01
    ora.racdev.racdev1.inst ONLINE ONLINE on tstorarac01
    ora.racdev.racdev2.inst ONLINE ONLINE on tstorarac02
    ora.racdev.racdev3.inst ONLINE ONLINE on tstorarac03
    -bash-3.00$ export ORACLE_SID=racdev
    -bash-3.00$ sqlplus / as sysdba
    SQL*Plus: Release 10.2.0.2.0 - Production on Tue Oct 31 10:55:03 2006
    Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
    Connected to an idle instance.
    SQL> exit
    Disconnected
    -bash-3.00$ export ORACLE_SID=racdev1
    -bash-3.00$ sqlplus / as sysdba
    SQL*Plus: Release 10.2.0.2.0 - Production on Tue Oct 31 10:55:15 2006
    Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - 64bit Production
    With the Partitioning, Real Application Clusters and Data Mining options
    SQL>

  • How to show superscript in ,java application?

    how to show superscript in ,java application? in command prompt and using JOptionPane.showMessageDialog()

    JOptionPane.showMessageDialog(null,"<html>4<sup>2</sup> = 16</html>");

  • How i can connect to devices using apple id

    how i can connect to devices that using apple id

    Asked, answered and marked as "Solved" at: https://discussions.apple.com/message/23456497#23456497#23456497

  • How i can connect ipad with ipad mini via bluetooth

    how i can connect ipad with ipad mini via bluetooth?

    for what purpos?
    this is what bluetooth profiles ios devices support out of the box
    http://support.apple.com/kb/HT3647?viewlocale=en_US&locale=en_US
    but there maybe more features supported by apps from app store as a bluetooth profiles such as PAN give the client server possiblities

  • How i can connect php and oracle9i ?

    hello am new to php.i have oracle 9i and php and apache.oracle is installed at one system and php inother one at network .when i have at same pc's i connect it.but now it's at different systems how i can connect.plzz tell me complete steps of apache that i will define and next complete process to connect php and oracle .plzzzzzzzzzzzzzzzzzzzzzzzzzzzz

    Apache and PHP need to be on the same system. That system also needs either the database or Oracle client libraries like Oracle Instant Client. There are steps for installation of the PHP side on http://www.oracle.com/technology/tech/php/index.html
    There are various Oracle installation notes in the Oracle manuals or software bundles.
    -- cj

  • How i can connect developer 6i & 2000 to databse 10g standerd-one

    How i can connect developer 6i & 2000 to databse 10g standerd addition one

    I don't think Developer 2000 is supported with 10g, I haven't tried it.
    Patch 18 for Forms 6i can only be downloaded from metalink since Forms 6i is no longer supported only limited support for E-Business Suite users.
    Why would waht to use Dev 200 and Forms 6i, these product are no longer supported, why no use the latest version of Forms Forms 10g R2???
    Tony

  • Is there a way how I can connect my iPod to my TV using my iPod USB charger

    Is there a way how I can connect my iPod touch to my flat screen tv using my iPod USB charger?

    No.
    Yu need either an Apple TV for AirPlay or an adopter cable
    iPhone, iPad, iPod: TV out support

Maybe you are looking for

  • HT4623 Can I transfer my iPad 2 account to a new iPad?

    My wife has an older iPad 2.  I want to buy her the New iPad.  Can I transfer her current account on her iPad 2 when I get the new iPad? How do I do that?

  • Satellite P30 - Blue screen after reinstall OS

    I just reinstall OS (Windows XP) on my older laptop Toshiba Satellite P30, but after first reboot (required to continue XP configuration) the DOS blue screen appear (System Has Recovered From Serious Error). The laptop cannot load Windows XP at all.

  • System variables in R/3 when badi is triggered from portal

    Hi,    How can we know the action from the portal,i mean from the create expense report i want to throw an error message if the user press "Review" button based on my validation. i have written in the badi,but when the user press "Previous step" butt

  • "no email program" – didn't ask to send a mail!

    Opening .pdfs with Reader XI (11.04) on Windows 7 keeps stalling; after a bit of checking and exploring, I found this is because of an alert box that is not showing up on top of the main Acrobat window. That's bad enough, but the alert itself doesn't

  • How to clear entity cache ?

    I am using ADF UIX with Struts as the controller. I have an entity object "Shipments" and two view objects "ShipmentsOL" and "ShipmentsUL". Different validation logic needs to be applied depending on whether or not the user is creating records throug