RMI with SSH

As I understand it, RMI listens on port 1099 and opens other ports upon a connection. This is why we have to open ports 1099 and >1023 on the server firewall. Which is great for all the users on the LAN.
The site will only let us connect to this system through SSH (port 22). We might be able to use ssh to create a poor mans VPN to connect to RMI as in: ssh -L 1234:localhost:1099 user@remotehost. This fails to work because RMI uses more than just port 1099. If it were something like telnet, ssh -L 1234:localhost:23 user@remotehost it would just work.
What I think I need is something running on the remote server which connects to port 1099 and listens on a port, for example, 1098. We could then connect with ssh -L 1234:localhost:1098 user@remotehost and packets would be passed to the appropriate RMI connection. Any ideas on how this could be done AND if it could work.
**CRITICAL: I am not interested in changing the application running RMI at all. It works for everthing the end users need and don't fix it if it isn't broken. In any case, this isn't just about RMI, there are three non-RMI apps which do the same thing, so one solution would be used for all four of them.

As I understand it, RMI listens on port 1099 and opens other ports upon a connection.No. The RMI Registry listens at port 1099 unless you tell it otherwise. Remote objects listen at system-chosen ports unless you specify a specific port when constructing/exporting them. You can use port 1099 for everything if:
1. You create the Registry via LocateRegistry.createRegistry() in the same JVM that exports your remote objects.
2. You cite port 1099 when constructing (super(1099)) or exporting (UnicastRemoteObject.exportObject(obj, 1099)) remote objects.
Having done that, the only server-side port you need to be concerned with is 1099. That's a reserved IANA port number and it should be possible to get it opened in the firewall.
And neither RMI nor TCP 'opens other ports' on inbound connections.

Similar Messages

  • Problem with ssh and bash-completion

    I and a co-worker are having a weird problem with ssh and bash-completion. We have a local config in .ssh/config with hosts we connect everyday. An example:
    host foo
    hostname foo.org
    user foobar
    host foobar
    hostname foobar.org
    user foobar
    When we try to type
    ssh foo<tab><tab>b<tab>
    the console just freeze and we can't type anything, everything we type is ignored, but after about 30 seconds the host is completed.
    This works a some time ago, so some upgrade make this happen. Anyone can reproduce this?

    quigybo wrote:
    Actually thinking about it, rather than using the semi-dodgy fix posted on the bug tracker, we can just test if the daemon is running since we are not on MacOS X. It is cleaner and 250 ms quicker.
    --- bash_completion.orig 2010-09-14 05:33:22.000000000 +0930
    +++ bash_completion 2010-09-14 05:45:04.000000000 +0930
    @@ -1316,10 +1316,12 @@
    # contains ";", it may mistify the result. But on Gentoo (at least),
    # -k isn't available (even if mentioned in the manpage), so...
    if type avahi-browse >&/dev/null; then
    - COMPREPLY=( "${COMPREPLY[@]}" $( \
    - compgen -P "$prefix$user" -S "$suffix" -W \
    - "$( avahi-browse -cpr _workstation._tcp 2>/dev/null | \
    - awk -F';' '/^=/ { print $7 }' | sort -u )" -- "$cur" ) )
    + if [ -n "$(pidof avahi-daemon)" ]; then
    + COMPREPLY=( "${COMPREPLY[@]}" $( \
    + compgen -P "$prefix$user" -S "$suffix" -W \
    + "$( avahi-browse -cpr _workstation._tcp 2>/dev/null | \
    + awk -F';' '/^=/ { print $7 }' | sort -u )" -- "$cur" ) )
    + fi
    fi
    # Add results of normal hostname completion, unless
    This is the same test as was used in bash-completion 1.1.
    Thanks  quigybo, I use your patch, the issue is gone
    Why does so many packages depends on Avahi? Maybe make it optdepends is
    enough?
    my laptop $ pacman -Qi avahi
    Required By : gnome-disk-utility gnome-vfs libcups mpd sane

  • A problem in RMI with JSP..pls help

    RMI with Java is working fine,but...
    1. I am facing a problem when i use RMI with JSP..its throwing an exception during "Naming.lookup"..here is my code snippet:
    // i have stored the ServerInf and other classes in a package and i have imported it in the jsp code....object ref is getting created but lookup is throwing an exception...thoguh RMI registry is working(started)
    <%
    try {
    ServerInf ref = (ServerInf)Naming.lookup("rmi://localhost:1098/Server_bind");
    catch (Exception ex) {
    ex.printStackTrace();
    %>
    Pls tel me the cause.
    2. If i try to use RMI with Servlet and JSP, then wen the JSP runs then, it simply calls the servlet file and displayes a lonk to it instead of executing the servlet class. pls help me with this too...below is the invoking statement:
    <form method=post action='http://localhost:8080/servlet/MyRMIservlet'>
    hello <input type=submit value=submit>

    And the exception and error message is.....

  • BizTalkServer 2010 SFTP Adapter from CodePlex - Configuring send and receive locations with SSH public and private keys

    Hi there,
    I am looking for step by step instrcutions on how to configure SFTP Codeplex adapter for both receive and send ports.
    Out business partner with whom we push/poll the files from wants us to use SSH encryption/decryption etc.
    Just wondering if the following functionality is supported in Codeplex SFTP adatper without having to write any code.
    Appreciate if there is manaul to do this for SFTP. BTW I do have all the our public and private keys and business partners Public key for configuring.
    For Send port: 1. we would need to encrypt the file with our business partners public key
                          2. sign the file with our private key.
                          3. Send the file through to SSH client which eventually transfers to Remote server.
    Receive port:   1. Connect to SSH Server with SSH-2 key and receive the file
                          2. Verify the file's digital signature agaisnt the Business partners PGP public key
                          3. Decrypt the file using our PGP Public key
    Thanks in advance

    Yes it is supported.
    You can find its documentation in this link 
    You can find section X.509 Certificate Identity Keys
    You can set public and private key in property SSH Identity thumbprint  of send and receive port
    I prefer to test it using client tool like
    FileZilla or WinSCP then test it using sftp adapter
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer

  • RMI with SSL problem (cross post under RMI too)

    Hi,
    I'm having problems using RMI with SSL. I posted in the RMI forum originally but now realise the problems are with the SSL really.
    Perhaps someone who follows this forum could help.
    See post:
    http://forum.java.sun.com/thread.jsp?forum=58&thread=409347
    Thanks.

    There's more dukes in the other thread too.

  • RMI with JDBC

    Hello,
    this is the first time that I work with RMI.
    In fact it isn't so hard.
    But I've made an interface that do the operations on my database.
    Do I also have to program a locking mechanism?
    Does anybody made such a system, or what do you recommand.
    I want to make a simpel program that uses a database on another pc.
    tnx

    Hi Twims
    Im asking if you could make me a favor... As I can see you know RMI with JDBC... And at this moment I need a client and server programs to connect to a database, execute SQL commands and retrieve information to client.
    If you could send me those programs please do it to [email protected] or [email protected]
    Thanks in advance
    ANDRES GONZALEZ

  • RMI with  JDBC program

    i want a program RMI with JDBC code included.

    Java RMI programs for implementing Author Registration.
    /* File Name : AuthorServerint.java
    Java Remote Interface for implementing Author Registration
    import java.rmi.*;
    public interface AuthorServerint extends java.rmi.Remote
              public void Update_Details(String autid, String name,String
                   title,String street, String city, String state, int pin)
                   throws java.rmi.RemoteException;
    File Name : AuthorServerimpl.java
    Java Interface implementation and Server program for implementing
    Author Registration
    import java.rmi.*;
    import java.sql.*;
    import javax.swing.*;
    public class AuthorServerimpl extends java.rmi.server.UnicastRemoteObject
              implements AuthorServerint
              static Connection con;
              static PreparedStatement ps;
              static ResultSet rs;
              static Statement st;
              int in;
              public AuthorServerimpl() throws java.rmi.RemoteException
                   super();
              public static void main(String args[])throws Exception
                   try{
                        AuthorServerint As=new AuthorServerimpl();
                        Naming.rebind("rmi://localhost/As",As);
                        System.out.println("Server ready");
              catch(Exception e){
                   System.out.println(e);
         public void Update_Details(String autid, String name,String
                   title,String street, String city, String state, int pin)
                   throws java.rmi.RemoteException
                   try{
                        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                        con=DriverManager.getConnection("Jdbc:Odbc:data");
                        st=con.createStatement();
                        if(autid.equals("") || name.equals("") || title.equals("") ||
                             street.equals("") || city.equals("") || state.equals(""))
                             JOptionPane.showMessageDialog(null,"Fill all the entries");
                        else{
                             in=st.executeUpdate("insert into Author values ('" autid
                                  "','"+name+"','"+title+"','"+street+"','"+ city+
                                  "','"+state+"','"+pin+"')");
                             if(in>0){          
                                  JOptionPane.showMessageDialog(null,"Data Updated");
                   catch(Exception e){}
    File Name : Authorclient.java
    Java Client program for implementing Author Registration
    import java.rmi.*;
    import java.io.*;
    import java.rmi.Naming;
    import java.sql.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    public class Authorclient extends JFrame implements ActionListener
              static JTextField tautid,tname,ttitle,tstreet,tcity,tstate,tpin;
              JLabel lautid,lname,ltitle,lstreet,lcity,lstate,lpin;
              static JButton Badd,Exit,Bclear;
              String autid,name,title,street,city,state;
              int pin;
              Authorclient()
                   Container C=getContentPane();
                   C.setLayout(new GridLayout(9,2));
                   lautid=new JLabel("Author Id");
                   lname=new JLabel("Author Name");
                   ltitle=new JLabel("Title");
                   lstreet=new JLabel("Street");
                   lcity=new JLabel("City");
                   lstate=new JLabel("State");
                   lpin=new JLabel("Pincode");
                   tautid=new JTextField(10);
                   tname=new JTextField(10);
                   ttitle=new JTextField(10);
                   tstreet=new JTextField(10);
                   tcity=new JTextField(10);
                   tstate=new JTextField(10);
                   tpin=new JTextField(10);
                   Badd=new JButton("SUBMIT");
                   Exit=new JButton("EXIT");
                   Bclear=new JButton("CLEAR");
                   Badd.addActionListener(this);
                   Exit.addActionListener(this);
                   Bclear.addActionListener(this);
                   C.add(lautid);
                   C.add(tautid);
                   C.add(lname);
                   C.add(tname);
                   C.add(ltitle);
                   C.add(ttitle);
                   C.add(lstreet);
                   C.add(tstreet);
                   C.add(lcity);
                   C.add(tcity);
                   C.add(lstate);
                   C.add(tstate);
                   C.add(lpin);
                   C.add(tpin);
                   C.add(Bclear);
                   C.add(Badd);
                   C.add(Exit);
                   setVisible(true);
                   resize(300,300);
         public void actionPerformed(ActionEvent ae)
                   if(ae.getActionCommand().equals("SUBMIT"))
                        try{
                             AuthorServerint A=(AuthorServerint)Naming.lookup ("rmi://
                                  localhost/As");
                             autid=tautid.getText();
                             name=tname.getText();
                             title=ttitle.getText();
                             street=tstreet.getText();
                             city=tcity.getText();
                             state=tstate.getText();
                             pin=Integer.parseInt(tpin.getText());
                             A.Update_Details(autid,name,title,street,city,state,pin);
                        catch(Exception E){}
                   else if(ae.getActionCommand().equals("EXIT"))
                        System.exit(0);
                   else if(ae.getActionCommand().equals("CLEAR"))
                        tautid.setText("");
                        tname.setText("");
                        ttitle.setText("");
                        tstreet.setText("");
                        tcity.setText("");
                        tstate.setText("");
                        tpin.setText("");
         public static void main(String args[])
                   new Authorclient();
    note: this program is done using swing components and need a database to run. The fields of the table("Author") database("data") are the same as the variable used in "Update_Details" function.
    Edited by: Amar on Oct 30, 2007 12:11 PM

  • Problem when access to CSS with SSH

    Hi,
    We have an strange issue when we try to access to the management of the CSS with SSH protocol: we need to put the username twice.
    Is it a normal behaviour?
    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Tabla normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-priority:99;
    mso-style-qformat:yes;
    mso-style-parent:"";
    mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
    mso-para-margin:0cm;
    mso-para-margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:11.0pt;
    font-family:"Calibri","sans-serif";
    mso-ascii-font-family:Calibri;
    mso-ascii-theme-font:minor-latin;
    mso-fareast-font-family:"Times New Roman";
    mso-fareast-theme-font:minor-fareast;
    mso-hansi-font-family:Calibri;
    mso-hansi-theme-font:minor-latin;}
    login as: test
    User Access Verification
    Username:test
    Password:
    /* Style Definitions */
    table.MsoNormalTable
    {mso-style-name:"Tabla normal";
    mso-tstyle-rowband-size:0;
    mso-tstyle-colband-size:0;
    mso-style-noshow:yes;
    mso-style-priority:99;
    mso-style-qformat:yes;
    mso-style-parent:"";
    mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
    mso-para-margin:0cm;
    mso-para-margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:11.0pt;
    font-family:"Calibri","sans-serif";
    mso-ascii-font-family:Calibri;
    mso-ascii-theme-font:minor-latin;
    mso-fareast-font-family:"Times New Roman";
    mso-fareast-theme-font:minor-fareast;
    mso-hansi-font-family:Calibri;
    mso-hansi-theme-font:minor-latin;}
    test# show version
    Version:               sg0810106 (08.10.1.06)
    Flash (Locked):        08.10.1.06
    Flash (Operational):   08.10.1.06
    Thanks.
    Best regards,
    Dani

    Hello Dani,
    This has been the behavior of the CSS when logging in via SSH since the product was introduced.  So yes, this is normal behavior for the CSS.
    Hope this helps,
    Sean

  • RMI with Activataion Group

    I am trying to implement RMI with Activation framework.
    While implementing i got the following error when i try to bind object via Naming.rebind() method.
    Creating group
    Creating detail about activatabale group object
    Binding the object
    Exception :java.rmi.ServerException: Server RemoteException; nested exception is
    java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
    java.lang.ClassNotFoundException: sun.rmi.server.ActivatableRef
    Thanks
    Nakul

    Hi,
    I had the same problem, after a while, I noticed that the wrong rmi registry was started. It seemed that I had more than one rmiregistry.exe files on my pc. When I started the correct registry, the problem was solved.
    Hope this helped you further,
    Bolle

  • Secured server with SSH and VPN?

    Hi,
    Have an Archbox at home and when I'm traveling I would like to connect to my Archlinux box at home to grab files and such things.
    Using ADSL with a static IP and a D-Link router.
    If I create a portfowarding rule of port 443 to my Archlinux box and user it to connect with SSH and VPN is that secured enought?
    I have family photos and stuff on the server that I don't want to be hacked or spread. Not a high target for hackers but for scriptkiddies!
    So, will a portforwarding rule and a use of SSH daemon and a VPN Server software make me secure all the way, the VPN and SSH is encrypted right?
    Any suggestions of a good VPN application?
    Server daemon for the "archserver" and clients for my laptop with dualboot, vista and archlinux.

    Yeah, SSH or OpenVPN should be perfectly fine.
    However, why port 443? If someone is scanning a large range of IP-addresses for commonly open ports to find active servers, they will most likely scan port 21, 22, 25, 80, 110, 443, etc. as these ports usually run the most interesting services.
    Since it has no impact on the usability, choose a high port, between 10000-65000, which is not commonly used. That way your system will not be identified as active by a simple portscan searching for active servers.
    You don't have to be worried about attacks targeted directly against you, if you don't have anything interesting on your system, a cracker wouldn't spend time on manually breaking into your system. Just mask yourself from worms etc. by using uncommon ports. Using SSH or OpenVPN will handle encryption, which ensures data integrity, even when you're connected to an unencrypted hotspot somewhere in the world on your vacation
    If you setup OpenVPN, you'll also have the possibility of routing all your Internet traffic throught your home system, which can be very handy in terms of surfing and checking mail from unencrypted hotspots around the world.

  • OEM12C BP1 Default preferred credentials with SSH key credentials ?

    Is it possible to configure Host Default Preferred Credentials to use a named credential created with SSH Key credentials ?
    The drop down list only lists credentials configured with host credential types.

    host target type has 2 out of the box credential set HostCredsNormal and HostCredsPriv
    And both these are of type HostCreds (Username and password)
    And there's code which assumes these to be of type HostCreds and process password.
    Hence these are left as is.
    What customers can do is, create additional credential set (emcli create_credential_set) and use HostSSHCreds type for it.

  • Remote access with ssh

    In this subject matter I am a newbie, reply accordingly.
    How to access a remote computer via Internet. Not sharing files but logging into a remote machine and for  executing  commands  on  a  remote  machine. A detail description how to setup with ssh or other, if possible.

    The arch wiki should help you out:
    http://wiki.archlinux.org/index.php/Using_SSHD_and_SSH
    Another question i have is: is it about automatically doing commands on a remote machine (script) or personally logging on and entering commands?
    For a script you'll need some additional configuration.
    General: Login on a remote machine:
    ssh [email protected]
    Password: mypasswd
    then you should be logged in to the remote machine, with the possibility to execute commands within the permissions the user has.

  • Runtime exec command parameters with SSH

    hey,
    Im trying to run a unix command using Process proc = Runtime.getRuntime().exec(command);
    It works fine until I tried to combine it with multiple commands.
    For example, I'm trying to run:
    ssh [email protected] 'ls -al'
    This returns a exit value of -1, command not found.
    ssh [email protected] ls works fine so I suspect its related to the extra parameters.
    I checked the Javadoc page for exec:
    The command argument is parsed into tokens and then executed as a command in a separate process. The token parsing is done by a StringTokenizer created by the call:
    new StringTokenizer(command)
    As expected, it tokenized:
    ssh
    [email protected]
    'ls
    -al'
    Is there any way to bypass this default tokenization by exec to include quotes as one token?
    If anyone has any ideas, let me know! Thanks!

    thanks, solves that part.. but if i use execute command with ssh and bsub(a clustering job queue-submitter), it does ot return the correct value.
    For example, if i do ssh [email protected] bsub -I ls using exec and the waitFor() method, the waitFor waits indefinitely.
    I can tell it ran the job and ended, because i checked via bjobs and it finished. So why isn't the java app getting the exit code from waitFor() back?
    If I run the program on the targeted machine, bsub -I ls, it works correctly.
    If i type in the console, ssh [email protected] bsub -I ls, it returns back the results correctly.
    info regarding bsub and bjobs here http://www.ncsa.uiuc.edu/UserInfo/Resources/Hardware/XeonCluster/Doc/Jobs.html

  • Configuring Parallel Concurrent Processing with ssh

    Happy New Year,
    Metalink Note 185489.1 describes setting up PCP so that the applmgr account on each node can rsh into the other apps tier nodes, but has anyone been successful in setting it up with ssh? I see that the last time this document was updated was in 2004, quite some time ago.
    Sincerely,
    Ted Persky
    Sun Microsystems, Inc.

    I have configured PCP in 11.5.10.2 having two application server with OS RHEL 4.0 as follows:
    a. On node app1 check whether the apps_sid listener is up and if it is down bring it up.
    b. Log in to the applications by system administrator responsibility and do the following steps:
    1. Check whether both the nodes are registered by navigating to Install > Nodes and verify.
    2. Navigate to Concurrent > Manager > Define and query for Internal Manager.
    3. In the secondary node box enter the name of <node2> and save the changes.
    4. Do the same for some other concurrent managers except Standard.
    5. For some concurrent managers do the reverse i.e. enter aap2 as the primary node and app1 as secondary node.
    6. Query whether service managers of the name Service Manager (<node2>) and Internal Monitor (<node2>) exists along with its <node1> counterparts.
    7. For Service Managers and Internal Monitors of both app1 and app2 define a ‘Standard’ workshift (IMP- The workshifts are not defined by default for IMON/SM since the IMON is a feature exclusively for PCP).
    8. Define a new concurrent manager of name Standard Manager2 with definitions same as that of a Standard Manager except that in the specialization rules form include a program, say, Active Users.
    9. Exclude the Active User program from the specialization rules of the Standard Manager.
    10. Stop and start the concurrent managers by executing the script adcmctl.sh.
    11. Check whether the FNDSM and FNDIMON processes have started on both the nodes. It should be, otherwise it is indicative of miss-configuration.
    12. Navigate to Concurrent > Manager > Administer form select the Standard Manager 2 and activate it.
    13. After it has activated check from the back-end of the second node whether the desired FNDLIBR processes have been started. It should be, otherwise it is indicative of miss-configuration.
    Regards,
    Nitesh.

  • Vulnerability with ssh in OpenSSH in an RHEL installation

    There was a security analysis run on one server which has RHEL 5.8 installed and it is showing security vulnerabilities with respect to ssh in OpenSSH with reference no CVE-2007-4752. The vulnerability solution in the security report is showing solution as below:
    Download and apply the upgrade from: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH
    I went to this site but it is showing lots of files on this site and it is not clear which patch/file to execute.
    I hope my query is clear as to how to take care of this vulnerability with ssh in OpenSSH in an RHEL installation.
    Please revert with the reply to my query.
    Regards

    975148 wrote:
    Request people in this forum to please revert.
    Regards
    You posted that second comment a mere three hours after starting this thread.
    Your urgency is irrelevant.   This is a Community discussion forum.   People are NOT just sitting around waiting for you to ask questions.   At all times, half the globe is asleep when you post.
    Next,
    You once again posted your question to other online discussion forums and failed to have the courtesy to mention the fact to anyone.
    http://www.unix.com/red-hat/236667-vulnerability-ssh-openssh-rhel-installation.html
    You've been cautioned about that habit before.
    You have your answer in that other forum site.
    This thread is locked.

Maybe you are looking for

  • Uploader doesn't show "My Documents" folder

    I am unable to upload a file to the PDF converter service; the uploader doesn't show "My Documents folder..?? Help!! Regards, Marshall

  • JSC and running webapp

    Hi, Sorry if this is the wrong place to post this message, but I am new to the Java/JSC forums. I am trying to use JSC 9 and when I try to run a web app I am creating the IDE fires up my text editor instead of my web browser. In the options my defaul

  • HTML/Javascript positioning air.Video object

    Hi all, Simple question which has been doing my head in all weekend! I have got a simple application that programmatically creates an Air Video object and attaches it to a camera as per         this.video = new air.Video( 320, 240 );         this.vid

  • Problem display

    I bought the compact z3 8 days ago. A few days ago I started to feel like if the display is not completely fitted to something below. I mean, when I push with the finger in the upper area of the display, it feels some space below. Making the pressure

  • Trying to get laptop to use printer hooked up to my PC.

    i have a Hp pavilion g7-1227nr laptop and a HP photosmart C5580 printer. i have downloaded every HP solution for the printer but nothing will let me print from my laptop (wireless)  to the printer that is hooked up to my PC. Both of my children have