Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

remote login via a gateway

3 views
Skip to first unread message

Helmut Jarausch

unread,
Nov 12, 2009, 11:30:15 AM11/12/09
to
Hi,

this is probably a very simple question, I just couldn't find
an answer to it.

I like to ssh to Server via Gateway

Instead of
ssh Gateway

and there

ssh Server

is there a possibility to do it in one ssh command
(perhaps similar to port forwarding (tunneling))

Many thanks for a hint,
Helmut.

--
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany

mikea

unread,
Nov 12, 2009, 11:56:49 AM11/12/09
to
Helmut Jarausch <jara...@skynet.be> wrote in <4afc3816$0$2864$ba62...@news.skynet.be>:

> Hi,
>
> this is probably a very simple question, I just couldn't find
> an answer to it.
>
> I like to ssh to Server via Gateway
>
> Instead of
> ssh Gateway
>
> and there
>
> ssh Server
>
> is there a possibility to do it in one ssh command
> (perhaps similar to port forwarding (tunneling))
>
> Many thanks for a hint,

ssh -t gateway "ssh destination"

--

Mike Andrews, W5EGO
mi...@mikea.ath.cx
Tired old sysadmin

Helmut Jarausch

unread,
Nov 12, 2009, 11:59:01 AM11/12/09
to
Helmut Jarausch wrote:
> Hi,
>
> this is probably a very simple question, I just couldn't find
> an answer to it.
>
> I like to ssh to Server via Gateway
>
> Instead of
> ssh Gateway
>
> and there
>
> ssh Server
>
> is there a possibility to do it in one ssh command
> (perhaps similar to port forwarding (tunneling))
>

Sorry for answering my own question,
but after I've submitted it I had a look
at the ssh "proxy mode" before.

So Jacob suggested

ssh -o ProxyCommand="ssh <GATEWAY> netcat %h %p" <SERVER>

which works just fine.
Many thanks for that, Jacob.

Helmut Jarausch

unread,
Nov 12, 2009, 12:00:49 PM11/12/09
to
mikea wrote:
> Helmut Jarausch <jara...@skynet.be> wrote in <4afc3816$0$2864$ba62...@news.skynet.be>:
>> Hi,
>>
>> this is probably a very simple question, I just couldn't find
>> an answer to it.
>>
>> I like to ssh to Server via Gateway
>>
>> Instead of
>> ssh Gateway
>>
>> and there
>>
>> ssh Server
>>
>> is there a possibility to do it in one ssh command
>> (perhaps similar to port forwarding (tunneling))
>>
>> Many thanks for a hint,
>
> ssh -t gateway "ssh destination"
>

Thanks Mike.
I wonder if there is a difference to the


ssh -o ProxyCommand="ssh <GATEWAY> netcat %h %p" <SERVER>

thing suggested by Jacob Nevins.
(Speed?)

mikea

unread,
Nov 12, 2009, 12:16:39 PM11/12/09
to
Helmut Jarausch <jara...@skynet.be> wrote in <4afc3ed5$0$2862$ba62...@news.skynet.be>:

> Helmut Jarausch wrote:
>> Hi,
>>
>> this is probably a very simple question, I just couldn't find
>> an answer to it.
>>
>> I like to ssh to Server via Gateway
>>
>> Instead of
>> ssh Gateway
>>
>> and there
>>
>> ssh Server
>>
>> is there a possibility to do it in one ssh command
>> (perhaps similar to port forwarding (tunneling))

> Sorry for answering my own question,
> but after I've submitted it I had a look
> at the ssh "proxy mode" before.
>
> So Jacob suggested
>
> ssh -o ProxyCommand="ssh <GATEWAY> netcat %h %p" <SERVER>
>
> which works just fine.
> Many thanks for that, Jacob.

Vielen Dank, Helmut. I just tried Jacob's proxy method, and that works
nicely. So now I have two ways to ssh through a gateway into a destination.

Jacob's method depends on netcat (or nc) being installed and findable on
the gateway, however, while `ssh -t gateway "ssh destination"' requires
only ssh on both.

0 new messages