How to login to remote machine using SSH?

Hi,
I have a requirement where in I am required to connect to a remote machine using SSH and execute some commands, say a tail -100 on some file over there and pull back output data from the remote machine.
I know we can use sockets to connect to remote machines and Runtime.exec to execute external commands. But I am unable to tie together the two of these to achieve whatever I want to do.
Is it possible to somehow connect w/o using a custom server socket? The problem is that there is no concrete list of servers to connect to. It will be decided by the user. So I will not be able to install a server socket on each and every machine.
Any help would be most appreciated. Thanks a lot.
With regards,
Ganesh

Hi,
I am writing a java program that will try to use a SSH client to connect to a remote machine. I do not want to log into every single remote machine to moitor stuff over there.
My plan goes like this:
Have a web application that can connect to a DB for all information regarding remote servers to be monitored.
Based on user selection of a particular server, use data from the DB to connect to the particular remote server and pull in some data.
Hope I am clear enough now. Thanks a lot.
Ganesh

Similar Messages

  • Creating a directory on a remote machine using a UNC path

    Hi all,
    Is it possible to create a directory on a remote machine using a UNC path such as \\Server\Share\Directory?
    If so, how would i go about this? (Sorry for the newbie question, that's exactly what I am!)
    Thanks,
    Rob

    The tables on your pages are images. Not very convenient if the visitor wants to copy the information and use it.
    Read this how to use tables :
    http://www.wyodor.net/blog/archives/2010/01/entry_297.html
    http://www.wyodor.net/blog/archives/2010/01/entry_298.html
    Samples :
    http://www.wyodor.net/mfi/Maaskant/Seabreeze.html
    http://www.wyodor.net/mfi/Maaskant/Experiment.html
    http://www.wyodor.net/mfi/roodhout/Prices.html
    And here's a non-iWeb page with a sortable table :
    http://www.wyodor.net/htmlegg/TallCard/TallAjax.html?pg=tablesorter
    Or use a database on the server with MySQL and make tables with PHP :
    http://www.google.com/search?q=create+html+table+with+data+from+mysql+database
    Here's a very simple way to do it :
    http://home.wyodor.net/w3school

  • When I try to connect to a remote machine using IPSecuritas, am getting the following error

    When am trying to connect to remote machine using IPSecuritas, I am getting the following error and hence not able to establish connection. Imported the security policy and when I start IPSec,  I get this error.
    Info     APP  IKE daemon started
    Info     APP  IPSec started
    Error    IKE  Foreground mode.
    Info     IKE  @(#)ipsec-tools CVS (http://ipsec-tools.sourceforge.net)
    Info     IKE  @(#)This product linked OpenSSL 0.9.7l 28 Sep 2006 (http://www.openssl.org/)
    Info     IKE  Reading configuration from "/Library/Application Support/Lobotomo Software/IPSecuritas/racoon.conf"
    Info     IKE  Resize address pool from 0 to 255
    Error    IKE  failed to bind to address 192.168.1.2[4500] (Address already in use).
    Info     APP  IKE daemon terminated
    Error    IKE  failed to bind to address 192.168.1.2[500] (Address already in use).
    Error    IKE  no address could be bound.
    Info     APP  IPSec terminated
    Please help me in fixing this issue. Thanks in advance!!..
    Thanks,
    RV

    Is this music purchased back in DRM days? I don't actually have any iTunes music so I can't test with my iTunes 7.5, but I know that without iTunes 10 you cannot even connect to the store anymore.  I wouldn't think that would require an active connection to the store all the time, otherwise how could you play music on a computer in the middle of nowhere?  Did you do something to trigger iTunes suddenly wanting to connect and check on machine authorization?

  • I can't login to solaris server using ssh(putty).

    Hi,
    I can't login to solaris server using ssh(putty).
    However I am able to login to that server using telnet.
    # pkginfo | grep -i ssh
    system SUNWsshcu SSH Common, (Usr)
    system SUNWsshdr SSH Server, (Root)
    system SUNWsshdu SSH Server, (Usr)
    system SUNWsshr SSH Client and utilities, (Root)
    system SUNWsshu SSH Client and utilities, (Usr)
    I see that ssh is running. Please suggest.
    # ps -ef | grep ssh
    root 392 1 0 Feb 27 ? 0:00 /usr/lib/ssh/sshd
    root 12523 392 0 Mar 03 ? 0:00 /usr/lib/ssh/sshd
    sbasha 12526 12523 0 Mar 03 ? 0:07 /usr/lib/ssh/sshd
    sbasha 10957 10954 0 Mar 03 ? 0:05 /usr/lib/ssh/sshd
    root 16495 16491 0 10:46:54 pts/2 0:00 grep ssh
    root 10954 392 0 Mar 03 ? 0:00 /usr/lib/ssh/sshd
    Thanks & Regards,
    -Gnanashekar-

    Hi,
    I found solution to the problem. By default sshd in solars 10 does not permit root logins.
    We need to edit /etc/ssh/sshd_config file as follows:
    PermitRootLogin yes
    and restart the sshd.
    #svcadm restart ssh
    Thanks & Regards,
    -GnanaShekar-

  • How can I make Time Machine use the ethernet cable to Time Capsule instead of the wireless connection? Wireless is too slow; has been taking 40 hours to create an initial 142 GB backup.

    How can I make Time Machine use the ethernet cable to Time Capsule instead of the wireless connection? Wireless is too slow; has been taking 40 hours to create an initial 142 GB backup.

    Plug in ethernet .. in the computer.. turn off wireless.

  • How to login the remote desktop with user id and password using coded ui

    we are using vs 2013, we have automated some automated test cases using coded ui. i have on problem while i am running the those test cases in remote system. here the scenario is "after executed one test case we need to restart the system. After restarted
     I have to login the remote system with user credentials to continues execution for the remaining test cases." it is very helpful to me.. so please guide me how to overcome these problem? 
    Thanks in advance ...

    Hi Divakar,
    As far as I know, there isn’t this feature of remote test in VS2013.
    I suggest that you could submit this feature request:
    http://visualstudio.uservoice.com/forums/121579-visual-studio. The Visual Studio product team is listening to user voice there. You can send your idea there so the others can vote it. If you submit this suggestion, you might post that link here which will
    benefit others who has the similar issue
    Regards
    Starain
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to test oracle is up and running in remote machine using shell script

    Hello,
    I need help to write an linux script.
    I have a java application server running on machine 192.168.5.20 and our oracle 10g standard 1.0.2 is running on machine 192.168.5.21.
    I have found script to start oracle when computer is turned on.
    But I cannot start my application server automatically since it depends on whether oracle is up and running or not on the remote machine.
    Therefore, in case of power failure or maintenance, our client has to call us to start application server.
    I would be grateful if someone can help me "How can I write script to check oracle is up and running in machine 192.168.5.21 from machine 192.168.5.20.
    For your information, I have no oracle installed in application server. So tnsping won't work.
    What I want is when power is back, application server script automatically and tesing for oracle server is up and running. If it is up, script will start application server.
    Thanking you.

    Hi,
    It's not failover or experimental. My application server uses JBOSS and JBOSS needs database name to start up. My enviroment is LAN. My database is in different machine as I mentioned before. So In case of power failure, I need to start my application server (JBoss) manually, because I need to confirm that oracle is already running before start app server.
    I want an automated script (when power is just on) to start my application server which will wait to check if the datbase server is up I will start application server.
    The scripts given above It works if appserver and db server in the same machine (my development machine).
    But when I test the script in my production applicaiton server, It shows sqlplus command not found (my app server does not have any oracle client installed).
    About hostname yes My applicaiton server hostname is hostapp1 and dabase server hostname is hostdat1.
    Do you think Is it possible to test the script without oracle client not installed. or It has to be done writing code like java program and test using jdbc connection.
    Best regards.

  • How to create a file on a remote machine using PrintStream

    I want to create an HTML file on a remote machine connect via LAN the path is "\\vineet\akh\" akh is folder where I want to save the HTML file. Now in PrintStream i can give only a local file. Please help how to do it

    .. You can do this in two ways!!
    1) easy way
    2) hard way
    1) EASY WAY
    .. as you know for write to a remote dir you must
    a) have shared remote dir
    b) have write permit on remote dir
    if you have point a) and b) the way to follow it's simple as the other user explained to you!!
    2) HARD WAY
    the hard way is to use RMI (Remote Method Invokation)
    i mean to create a service on a remote machine that give to you a remote method that make you write without share anything..!!!
    check it out
    http://tns-www.lcs.mit.edu/manuals/java-api-1.1beta2/guide/rmi/
    i hope i'm been clear!!
    SORRy My english!! (please)
    Alessandro

  • Ssh login works but main login on remote machine does not

    I have a PPC Mac mini with Tiger installed at a co-locate with a static ip. I also have remote desktop and I recently discovered that although I can successfully log into my remote machine on a terminal using ssh I can't log into the machine using RD. It connects, in other words I see my remote desktop with the choices for logging in. But if I choose my account, which is the only one to choose, and enter my password I get the shakes, the dialog shakes letting me know I did something wrong. I know my password is right because I have it written down and I can log in using ssh. Why would these be different? My apologies if this question is not in the right forum. I wasn't sure where to post this.

    Have you set up the account in the Sharing -> Remote Desktop -> Access Privileges to allow connection and the appropriate functions?

  • How to execute a shell script which is present in remote machine using ODI

    I have requirement of executing a batch (shell script) which is present in the remote machine.
    i have an ODI agent in remote machine as well. I have created agent locally by using the remote machine IP and port.
    I am able to test the agent successfully. But when i am executing the package using that agent it is failing with the following error
    errorODI-1226: Step Execution of the Scenario REMOTE_DEMO version 001 fails after 1 attempt(s).
    ODI-1241: Oracle Data Integrator tool execution fails.
    Caused By: oracle.odi.runtime.agent.invocation.InvocationException: HTTP/1.1 500 ODI-1423: Warning connecting to Agent localagent: work repository WORKREP1 is not bound to the master
    My Work Repository Name is : WORKREP1
    Remote Work Repository Name is:WORKREP_LOCAL.
    Could anyone please help me regarding this.
    I can't download shell script and run it locally this needs to be run on that remote machine only.
    Thanks
    senthilkumar

    This is the code.
    1. we can declare types dynamically
    2. Internal table dynamically
    3. Select querry dynamically
    just copy paste this code
    Here is the code for your question
    DATA:v_fieldname
    TYPE fieldname,
    l_PROG TYPE string,
    v_mess TYPE string,
    l_sid TYPE string,
    wa_ddfields TYPE dntab.
    DATA i_tab TYPE STANDARD TABLE OF string.
    DATA:l_str TYPE string,
    l_str1 TYPE string.
    PARAMETERS matnr type marc-matnr.
    end-of-SELECTION.
    *build the subroutine pool
    APPEND 'PROGRAM subpool.' TO i_tab.
    APPEND `LOAD-OF-PROGRAM.` TO i_tab.
    APPEND `DATA i_tab1 TYPE TABLE OF vbak.`      TO i_tab.
    APPEND `DATA l_rows TYPE i.`      TO i_tab.
    APPEND `select * into table i_tab1 from vbak.` To i_tab.
    append 'DESCRIBE TABLE i_tab1 LINES l_rows.' to i_tab.
    append 'Write :  l_rows .' to i_tab.
    GENERATE SUBROUTINE POOL i_tab NAME l_PROG
    MESSAGE v_mess
    SHORTDUMP-ID l_sid.
    IF sy-subrc = 0.
    PERFORM ('LOOP_AT_TAB') IN PROGRAM (l_PROG) IF FOUND.
    ELSEIF sy-subrc = 4.
    MESSAGE v_mess TYPE 'I'.
    ELSEIF sy-subrc = 8.
    MESSAGE l_sid TYPE 'I'.
    ENDIF.
    Edited by: vijay wankhade on Jan 1, 2009 5:34 PM
    Edited by: vijay wankhade on Jan 1, 2009 5:34 PM

  • How to startx on remote machine's monitor

    Hi there,
    I would like to startx on a remote machine, having the X session on that remote machine's display/monitor.
    Background: My machines all run Arch linux, and they all dont use a graphical login manager (like GDM or KDM or such). I usually log into tty, and type in "startx" to start my XFCE4 session. While on work, I sometimes connect to my home-machine via VNC. This works nice. Sometimes, I do stuff that requires my remote machine (at home) to reboot.
    If I do so, there is no way to re-connect to the machine, as my VNC-connection needs a running X session (for x11vnc in my case). So, I need a procedure to somehow connect to my freshly rebooted remote machine (to TTY1) in order to type in username, password and "startx".
    Could someone please give a hint how to do that?
    Last edited by produnis (2015-01-17 17:14:56)

    Would https://wiki.archlinux.org/index.php/Xpra work?

  • Not able to access database from a remote machine using SQL Server Management Studio

    Hi,
    I have a DB_BOX with SQL Server 2008 R2 installed. I can access the databases on the local machine using SQL Server Management Studio but it is not accessible from other machines, though the machines are in same domain.
    I have remote enabled on SQL Server box, TCP enabled, firewall off. I checked with IP Address too, all SQL Server services are running.
    The SQL Server log shows the message
    The requested service has been stopped or disabled and is unavailable at this time. The connection has been closed.
    I get the below message in SSMS from remote machine.
    Details of error message are
    ===================================
    Cannot connect to DB_BOX.
    ===================================
    A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - The specified network name is no longer available.) (.Net SqlClient Data Provider)
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=64&LinkId=20476
    Server Name: DB_BOX
    Error Number: 64
    Severity: 20
    State: 0
    Program Location:
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
       at System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParserStateObject.ReadNetworkPacket()
       at System.Data.SqlClient.TdsParserStateObject.ReadBuffer()
       at System.Data.SqlClient.TdsParserStateObject.ReadByte()
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
       at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
       at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
       at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()
       at Microsoft.SqlServer.Management.SqlStudio.Explorer.ObjectExplorerService.ValidateConnection(UIConnectionInfo ci, IServerType server)
       at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()

    Sorry, missed the message from the errorlog in the original post. You shouldn't have included that big .Net dump that hid the important facts. :-)
    My first Google attempt on that message (which I have never seen before) suggests that the TCP Enpoint is stopped, so try this:
    ALTER ENDPOINT [TSQL Default TCP]
    STATE=STARTED;
    Erland Sommarskog, SQL Server MVP, [email protected]
    This solves the problem. Thanks...

  • Cluster setup in remote machines using weblogic8.1??

              Hi,
              How to run a clustered setup in remote machines??
              This is my setup:
              I have a domain called mydomain
              I have three server instances Adminserver, ManagedServer1 and ManagedServer2.
              I have a cluster called cluster1 with two servers , (ManagedServer1 and ManagedServer2).
              I have two machines, machine1(localhost) and machine2(remote machine connected
              to LAN).
              My machine1 has two servers , Adminserver, ManagedServer1 and
              My machine2 has one server ManagedServer2.
              I have installed weblogic 8.1 in both the machines.
              I have started nodemanager in machine1 .
              Iam able to run Adminserver and Managedserver1 in machine1(localhost)
              My question:
              1. I have to run the managedserver2 in the remote machine.
              2. Should i create a domain of the same name called mydomain in machine2(remote
              machine)???
              3. Already nodemanager is running in machine1.............Should i run nodemanager
              in machine2(remote machine) also ???
              4. What should be my configuration parameters (Java home, bea home,classpath,rootdirectory,arguments)
              for managedserver2 ??? should these details be with respect to machine1 or machine2???
              thanks&rgds,
              girish
              

    you just need to install wls and configure the domain there on that machine
              2 and run the startmanagedserver script to use the admin server url and it
              will get its configuration from there. better yet, if you have a shared
              installation use that.
              "Girish" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Hi,
              > How to run a clustered setup in remote machines??
              >
              > This is my setup:
              > I have a domain called mydomain
              > I have three server instances Adminserver, ManagedServer1 and
              ManagedServer2.
              > I have a cluster called cluster1 with two servers , (ManagedServer1 and
              ManagedServer2).
              > I have two machines, machine1(localhost) and machine2(remote machine
              connected
              > to LAN).
              > My machine1 has two servers , Adminserver, ManagedServer1 and
              > My machine2 has one server ManagedServer2.
              >
              > I have installed weblogic 8.1 in both the machines.
              > I have started nodemanager in machine1 .
              > Iam able to run Adminserver and Managedserver1 in machine1(localhost)
              >
              > My question:
              > 1. I have to run the managedserver2 in the remote machine.
              > 2. Should i create a domain of the same name called mydomain in
              machine2(remote
              > machine)???
              > 3. Already nodemanager is running in machine1.............Should i run
              nodemanager
              > in machine2(remote machine) also ???
              > 4. What should be my configuration parameters (Java home, bea
              home,classpath,rootdirectory,arguments)
              > for managedserver2 ??? should these details be with respect to machine1 or
              machine2???
              >
              >
              > thanks&rgds,
              > girish
              

  • How to search on Time Machine using Yosemite OS X?

    Is searching on Time Machine different using Yosemite OS X?

    Hi Bruce,
    This article give an excellent explanation of how to search in Time Machine under Mac OS X 10.10 (Yosemite).
    OS X Yosemite: Recover items using Time Machine and Spotlight
    Thanks for using Apple Support Communities.
    Best,
    Brett L 

  • Remote access using ssh/vnc

    Hi All!
    Recently, I have managed to configure my Airport Base station to accept SSH using the port mapping/forwarding feature...
    The main goal is to remotely access my mac in the office using SSH and VNC.
    I was able to do this however remote Mac is using a high resolution which makes it slow to manage.[really slow].
    I am currently using a Windows SSH tool called Putty.. and Real VNC to manage remote mac.
    I tried to change the setting of Real VNC to a lower resolution but it would not work..accessing the remote mac will only work if my Windows VNC is set to use the
    "Full" colour level.
    Is this a windows issue? I haven't tried using a VNC for Mac though..
    any other tool that is available out there aside from Apple Remote desktop?
    Thanks, All!!!!
    DP

    so the system server VNC refers to the MAC os x VNC...
    No, Vine Server's System Server is Vine Server starting up at boot time and is always running. Vine Server existed before Mac OS X included its own VNC server, so Vine Server's terminology is a bit confusing, but it wasn't when the started using it (it even sounds confusing when I just said it ).
    the Vine server itself is the stand alone vnc.
    Yes. The Vine Server is a totally separate VNC server implementation. It may be run interactively, or it may be configured to start at system boot time so it is always running (this is the system server mode of Vine Server).
    so , OS X's VNC is set to only accept high res..
    I do not know if it can ONLY do the resolution of the display, but anytime I've tried to use a VNC client configured for lower resolution, the Mac OS X VNC server has not behaved well. Rather than fight it, I just resort to Vine Server. It has been a rock solid VNC server.
    so connecting to the Vine server should be at any port not the 5900as this is the mac os vnc default port.
    If you MAKE ABSOLUTELY SURE that the Mac OS X VNC server is NOT running, you can use port 5900 for Vine Server, but I find it is safer to just give the Vine Server its own port, and commonly that is port 5901, but the Vine Server can be configured to use any port you desire.
    Since I do not use a VNC client on Windows, I can not recommend any clients. However, I have heard of the following:
    RealVNC
    TightVNC
    UltraVNC
    I am sure there are others, but not being plugged into Windows culture, my depth of knowledge is very limited.

Maybe you are looking for

  • Opinions on which size i should get.

    ok i am looking at getting a display over the summer, probably a 23 or 30 inch. im planning to get one of the tv tuners from elgato and just use my machine/display combo as my tv along with using it for working on. im an art student but i dont do muc

  • PDF created with InDesign CS6, Helvetica Neue font, causes lower-case "r's" to be bold

    The pdf was created from InDesign CS6 using Windows 7. I cannot recreate the problem on my machine, but it is happening on a coworker's machine. The only character affected is the lower-case r. It appears bold when viewing the pdf of his machine. I a

  • Auxiliary account assignment to asset not possible -aa449

    Hi, when i try  to sell an asset in F-92  i am getting the  error message "Auxiliary account assignment to asset not possible" .evenafter applying notes problem continues. guru any solution ? Edited by: kumaraguru v on Aug 28, 2008 7:41 AM

  • Prime Infrastructure 1.3 - Incorrect work with latest version of Addobe Flash Player.

    Good day! I try to view all information about user who associated to Wireless Controller in Cisco Prime Infrastructure 1.3, but all browsers that I use (Firefox 20.0.1, Chrome 26.0.1410.64 m) are crash on this step:   Does somebody have the same issu

  • Message "Unable to Check for Updates"

    Trying to select software updates under GENERAL.    Getting error popup message "Unable to Check for Update.   An error occurred while checking for a software update.    I can try again or cancel.    Cancel brings me back to Settings/General screen.