ssh X tunneling through more than one server - SSH

This is a discussion on ssh X tunneling through more than one server - SSH ; Hi there, I would like to remotely run an X application on my Ubuntu machine at home. The application is on a Unix server at work. I can easily access the Unix system by ssh -X unix1.work I can also ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: ssh X tunneling through more than one server

  1. ssh X tunneling through more than one server

    Hi there,

    I would like to remotely run an X application on my Ubuntu machine at
    home. The application is on a Unix server at work. I can easily access
    the Unix system by

    ssh -X unix1.work

    I can also run X applications from unix1 on my computer. My problem is
    that the application I want to use is on a different machine: unix2. I
    can log on to this machine with rlogin:

    [bierholen@unix1 ~]$ rlogin unix2
    [...]
    unix2%

    Running X applications from unix2 on my computer doesn't work:

    unix2% xclock
    Error: Can't open display:

    That makes sense to me. My question now is if it is possible at all to
    run applications from unix2 on my computer. I can't connect directly
    to unix2. I always have to go via unix1. I played around quite a bit
    but I couldn't make it work.

    Thanks for any help!
    Edit/Delete Message


  2. Re: ssh X tunneling through more than one server

    On 19 May 2007 11:45:03 -0700, Bierholen wrote:
    >
    > [bierholen@unix1 ~]$ rlogin unix2
    > [...]
    > unix2%
    >
    > Running X applications from unix2 on my computer doesn't work:
    >
    > unix2% xclock
    > Error: Can't open display:


    You might try
    echo $DISPLAY
    rlogin unix2
    export DISPLAY=(value from unix1 here) on unix2


  3. Re: ssh X tunneling through more than one server

    On Sat, 19 May 2007 11:45:03 -0700, Bierholen wrote:

    > Hi there,
    >
    > I would like to remotely run an X application on my Ubuntu machine at
    > home. The application is on a Unix server at work. I can easily access
    > the Unix system by
    >
    > ssh -X unix1.work
    >
    > I can also run X applications from unix1 on my computer. My problem is
    > that the application I want to use is on a different machine: unix2. I
    > can log on to this machine with rlogin:
    >
    > [bierholen@unix1 ~]$ rlogin unix2
    > [...]
    > unix2%
    >
    > Running X applications from unix2 on my computer doesn't work:
    >
    > unix2% xclock
    > Error: Can't open display:
    >
    > That makes sense to me. My question now is if it is possible at all to
    > run applications from unix2 on my computer. I can't connect directly to
    > unix2. I always have to go via unix1. I played around quite a bit but I
    > couldn't make it work.
    >
    > Thanks for any help!


    This is what I use:

    Let's call your box M1. You can access unix1 from M1 via SSH, and
    unix1 can access unix2 via SSH. You would like to access unix2 directly
    from M1 via SSH. In M1 you would do the following:

    ssh -fngT -L 3022:unix2:22 -C unix1 ping -i 30 localhost > /dev/
    null 2>&1

    With this running, the command

    ssh -p 3022 localhost

    issued on M1 should give you a shell on unix2.

    If in M1 we add to .ssh/config the entry

    Host unix2
    HostName localhost
    HostKeyAlias unix2
    User Username
    Port 3022

    (where Username is your user name on unix2) then you get your shell on
    unix2 by typing

    ssh unix2

    in M1.

  4. Re: ssh X tunneling through more than one server

    [...]

    > This is what I use:
    >
    > Let's call your box M1. You can access unix1 from M1 via SSH, and
    > unix1 can access unix2 via SSH. You would like to access unix2 directly
    > from M1 via SSH. In M1 you would do the following:
    >
    > ssh -fngT -L 3022:unix2:22 -C unix1 ping -i 30 localhost > /dev/
    > null 2>&1
    >
    > With this running, the command
    >
    > ssh -p 3022 localhost
    >
    > issued on M1 should give you a shell on unix2.


    I get the following error message:

    ssh_exchange_identification: Connection closed by remote host

    [...]

    I'm not sure if unix1 can access unix2 via SSH because if I do

    ssh unix2

    within unix1, I'll get:

    ssh: connect to host unix2 port 22: Connection refused


  5. Re: ssh X tunneling through more than one server

    On Sun, 20 May 2007 11:58:57 -0700, Bierholen wrote:

    > [...]
    >
    >> This is what I use:
    >>
    >> Let's call your box M1. You can access unix1 from M1 via SSH,
    >> and
    >> unix1 can access unix2 via SSH. You would like to access unix2 directly
    >> from M1 via SSH. In M1 you would do the following:
    >>
    >> ssh -fngT -L 3022:unix2:22 -C unix1 ping -i 30 localhost >
    >> /dev/
    >> null 2>&1
    >>
    >> With this running, the command
    >>
    >> ssh -p 3022 localhost
    >>
    >> issued on M1 should give you a shell on unix2.

    >
    > I get the following error message:
    >
    > ssh_exchange_identification: Connection closed by remote host
    >
    > [...]
    >
    > I'm not sure if unix1 can access unix2 via SSH because if I do
    >
    > ssh unix2
    >
    > within unix1, I'll get:
    >
    > ssh: connect to host unix2 port 22: Connection refused


    Well, unix2 might be listening for incoming SSH connections at
    some other port, instead of the default 22. The scheme above critically
    depends on unix2 being accessibly from unix1 via SSH, no matter what
    port.

  6. Re: ssh X tunneling through more than one server

    [...]

    > Well, unix2 might be listening for incoming SSH connections at
    > some other port, instead of the default 22. The scheme above critically
    > depends on unix2 being accessibly from unix1 via SSH, no matter what
    > port.


    I understand that. How can I find out which port it is?


  7. Re: ssh X tunneling through more than one server

    Bierholen writes:

    > [...]
    >
    >> Well, unix2 might be listening for incoming SSH connections at
    >> some other port, instead of the default 22. The scheme above critically
    >> depends on unix2 being accessibly from unix1 via SSH, no matter what
    >> port.

    >
    > I understand that. How can I find out which port it is?


    Assuming you have access, examine the /etc/ssh/sshd_config file and
    look for the "Port xyz" keyword on unix2.
    --
    % Randy Yates % "She has an IQ of 1001, she has a jumpsuit
    %% Fuquay-Varina, NC % on, and she's also a telephone."
    %%% 919-577-9882 %
    %%%% % 'Yours Truly, 2095', *Time*, ELO
    http://home.earthlink.net/~yatescr

  8. Re: ssh X tunneling through more than one server

    On May 20, 7:11 pm, Randy Yates wrote:
    > Bierholen writes:
    > > [...]

    >
    > >> Well, unix2 might be listening for incoming SSH connections at
    > >> some other port, instead of the default 22. The scheme above critically
    > >> depends on unix2 being accessibly from unix1 via SSH, no matter what
    > >> port.

    >
    > > I understand that. How can I find out which port it is?

    >
    > Assuming you have access, examine the /etc/ssh/sshd_config file and
    > look for the "Port xyz" keyword on unix2.


    I found /etc/sshd_config but it is empty. Also, doing ssh in unix2
    gives me

    6603:ssh: rld: Fatal Error: Cannot Successfully map soname 'libz.so'
    under any of the filenames /usr/lib32/libz.so:/usr/lib32/internal/
    libz.so:/lib32/libz.so:/opt/lib32/libz.so:/usr/lib32/libz.so.1:/usr/
    lib32/internal/libz.so.1:/lib32/libz.so.1:/opt/lib32/libz.so.1:

    I guess unix2 can't connect to unix1 via ssh :-(


  9. Re: ssh X tunneling through more than one server

    Bierholen writes:

    > On May 20, 7:11 pm, Randy Yates wrote:
    >> Bierholen writes:
    >> > [...]

    >>
    >> >> Well, unix2 might be listening for incoming SSH connections at
    >> >> some other port, instead of the default 22. The scheme above critically
    >> >> depends on unix2 being accessibly from unix1 via SSH, no matter what
    >> >> port.

    >>
    >> > I understand that. How can I find out which port it is?

    >>
    >> Assuming you have access, examine the /etc/ssh/sshd_config file and
    >> look for the "Port xyz" keyword on unix2.

    >
    > I found /etc/sshd_config but it is empty. Also, doing ssh in unix2
    > gives me
    >
    > 6603:ssh: rld: Fatal Error: Cannot Successfully map soname 'libz.so'
    > under any of the filenames /usr/lib32/libz.so:/usr/lib32/internal/
    > libz.so:/lib32/libz.so:/opt/lib32/libz.so:/usr/lib32/libz.so.1:/usr/
    > lib32/internal/libz.so.1:/lib32/libz.so.1:/opt/lib32/libz.so.1:
    >
    > I guess unix2 can't connect to unix1 via ssh :-(


    Sounds like you've got a botched ssh install on unix2. But I'm not
    a unix or ssh expert - just a user with a little dangerous knowledge.
    --
    % Randy Yates % "Though you ride on the wheels of tomorrow,
    %% Fuquay-Varina, NC % you still wander the fields of your
    %%% 919-577-9882 % sorrow."
    %%%% % '21st Century Man', *Time*, ELO
    http://home.earthlink.net/~yatescr

+ Reply to Thread