0

I have 3 computers A, B and C, where there is no direct connection between A and C.

I need an access to the computer C from the computer A.

The computer C is behind a firewall and can only reverse tunnel on the computer B.

A has access to B with a specific user, and B can only access to another user on C.

I wanted to know if there is a way to connect A to C through B with this configuration. (It would be even better without using a configuration file)

The command used by C to reverse tunnel on B is (this is not the problem, it works well):

ssh -v -N -R 2222:localhost:9876 IP_OF_B

I saw that I needed to do a connection hopping with something like this (from A):

ssh -W ACCOUNT_ON_C@localhost:2222 USER_ON_B@IP_OF_B

But when I do this, I get an error : channel 0: open failed: administratively prohibited: open failed

By the way, all of the 3 computers run linux.

2
  • did you try to put all the information into ssh_config? It looks like a real mess from this point of view. In config you can specify and see all the options in one place.
    – Jakuje
    Nov 16, 2015 at 13:53
  • I can set the configuration for B in my ssh_config, but the configuration for C changes everytime, so I cannot really do this.
    – 4rzael
    Nov 16, 2015 at 14:04

1 Answer 1

1

what's wrong with .. ?

ssh -t -l userB B ssh -l userC C

where

  • userX is user on host X
  • -t force tty allocation.
3
  • this method will not allow authentication using local keys.
    – Jakuje
    Nov 16, 2015 at 14:06
  • Hum, there is nothing wrong with this, that's exactly what I wanted to do ! Thanks !
    – 4rzael
    Nov 16, 2015 at 14:09
  • @Jakuje what error are you having ?
    – Archemar
    Nov 16, 2015 at 14:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .