ALT Linux sysadmins discussion
 help / color / mirror / Atom feed
* [Sysadmins] ssh tunnel
@ 2009-11-24 13:47 Alexander Volkov
  2009-11-24 14:07 ` Pavel
  2009-11-24 14:09 ` Alexey I. Froloff
  0 siblings, 2 replies; 10+ messages in thread
From: Alexander Volkov @ 2009-11-24 13:47 UTC (permalink / raw)
  To: sysadmins

Привет всем!
Коллеги, направьте на путь истины, что-то никак не уложу в голове :)
Есть Сервер_А, Сервер_Б и Клиент_В.
Задача - подключить Клиента_В через Сервер_Б на Сервер_А:портА.
Клиент ssh не умеет.
Нужный порт с сервера_А на Сервер_Б прокидывается:
ssh -R портА:Сервер_Б:портБ Сервер_Б
Но портБ на Сервере_Б при этом доступен только на localhost.
А как его наружу выставить?

--
 Regards, Alexander



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Sysadmins] ssh tunnel
  2009-11-24 13:47 [Sysadmins] ssh tunnel Alexander Volkov
@ 2009-11-24 14:07 ` Pavel
  2009-11-24 14:14   ` Alexander Volkov
  2009-11-24 14:09 ` Alexey I. Froloff
  1 sibling, 1 reply; 10+ messages in thread
From: Pavel @ 2009-11-24 14:07 UTC (permalink / raw)
  To: sysadmins

Hello, Alexander Volkov. On 24.11.2009 17:47 you wrote,
> Нужный порт с сервера_А на Сервер_Б прокидывается:
> ssh -R портА:Сервер_Б:портБ Сервер_Б
> Но портБ на Сервере_Б при этом доступен только на localhost.
> А как его наружу выставить?

В моем мане по ssh у опции -R четыре параметра:
-R [bind_address:]port:host:hostport


-- 
Best regards, Pavel
mail/xmpp: p2n-at-ya-dot-ru



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Sysadmins] ssh tunnel
  2009-11-24 13:47 [Sysadmins] ssh tunnel Alexander Volkov
  2009-11-24 14:07 ` Pavel
@ 2009-11-24 14:09 ` Alexey I. Froloff
  2009-11-24 14:19   ` Alexander Volkov
  1 sibling, 1 reply; 10+ messages in thread
From: Alexey I. Froloff @ 2009-11-24 14:09 UTC (permalink / raw)
  To: sysadmins

[-- Attachment #1: Type: text/plain, Size: 378 bytes --]

On Tue, Nov 24, 2009 at 04:47:58PM +0300, Alexander Volkov wrote:
> Нужный порт с сервера_А на Сервер_Б прокидывается:
> ssh -R портА:Сервер_Б:портБ Сервер_Б
> Но портБ на Сервере_Б при этом доступен только на localhost.
> А как его наружу выставить?
Прочитать man ssh?

     -g      Allows remote hosts to connect to local forwarded ports.

-- 
Regards,
Sir Raorn.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Sysadmins] ssh tunnel
  2009-11-24 14:07 ` Pavel
@ 2009-11-24 14:14   ` Alexander Volkov
  2009-11-24 15:17     ` Pavel
  0 siblings, 1 reply; 10+ messages in thread
From: Alexander Volkov @ 2009-11-24 14:14 UTC (permalink / raw)
  To: sysadmins

On 2009-11-24 18:07:03 +0400, Pavel wrote:
P> Hello, Alexander Volkov. On 24.11.2009 17:47 you wrote,
P> > Нужный порт с сервера_А на Сервер_Б прокидывается:
P> > ssh -R портА:Сервер_Б:портБ Сервер_Б
P> > Но портБ на Сервере_Б при этом доступен только на localhost.
P> > А как его наружу выставить?

P> В моем мане по ssh у опции -R четыре параметра:
P> -R [bind_address:]port:host:hostport
В очередной раз убеждаемся, что русский man надо отправить фтопку...
Однако попробовал - не вышло на внешний тырфейс повиснуть: 
netlist
USER     PID   COMMAND FD TYPE       LOCAL IP:PORT        REMOTE IP:PORT
STATE
vaa      -     -        - tcp       127.0.0.1:портБ         0.0.0.0:0
LISTEN

--
 Regards, Alexander



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Sysadmins] ssh tunnel
  2009-11-24 14:09 ` Alexey I. Froloff
@ 2009-11-24 14:19   ` Alexander Volkov
  2009-11-24 15:15     ` Alexey I. Froloff
  0 siblings, 1 reply; 10+ messages in thread
From: Alexander Volkov @ 2009-11-24 14:19 UTC (permalink / raw)
  To: sysadmins

On 2009-11-24 17:09:58 +0300, Alexey I. Froloff wrote:
AIF> On Tue, Nov 24, 2009 at 04:47:58PM +0300, Alexander Volkov wrote:
AIF> > Нужный порт с сервера_А на Сервер_Б прокидывается:
AIF> > ssh -R портА:Сервер_Б:портБ Сервер_Б
AIF> > Но портБ на Сервере_Б при этом доступен только на localhost.
AIF> > А как его наружу выставить?
AIF> Прочитать man ssh?

AIF>      -g      Allows remote hosts to connect to local forwarded ports.
а как remote hosts смогут попасть на 127.0.0.1?

--
 Regards, Alexander



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Sysadmins] ssh tunnel
  2009-11-24 14:19   ` Alexander Volkov
@ 2009-11-24 15:15     ` Alexey I. Froloff
  0 siblings, 0 replies; 10+ messages in thread
From: Alexey I. Froloff @ 2009-11-24 15:15 UTC (permalink / raw)
  To: sysadmins

[-- Attachment #1: Type: text/plain, Size: 298 bytes --]

On Tue, Nov 24, 2009 at 05:19:22PM +0300, Alexander Volkov wrote:
> AIF> > А как его наружу выставить?
> AIF> Прочитать man ssh?
> AIF>      -g      Allows remote hosts to connect to local forwarded ports.
> а как remote hosts смогут попасть на 127.0.0.1?
Чудом.

-- 
Regards,
Sir Raorn.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Sysadmins] ssh tunnel
  2009-11-24 14:14   ` Alexander Volkov
@ 2009-11-24 15:17     ` Pavel
  2009-11-24 15:20       ` Pavel
  2009-11-25  7:33       ` Alexander Volkov
  0 siblings, 2 replies; 10+ messages in thread
From: Pavel @ 2009-11-24 15:17 UTC (permalink / raw)
  To: sysadmins

Hello, Alexander Volkov. On 24.11.2009 18:14 you wrote,
> Однако попробовал - не вышло на внешний тырфейс повиснуть: 
Если я правильно понял вашу задачу, то:
1. в sshd_config на сервере_Б д.б.
GatewayPorts = yes
2. с сервера_Б коннектимся по ssh на сервер_А, пробрасывая
локальный порт_Б на сервер_А:порт_А
ssh  -L сервер_Б:порт_Б:сервер_А:порт_А  сервер_А
3. клиентом_В коннектимся к серверу_Б:порт_Б и попадаем на
сервер_А:порт_А


-- 
Best regards, Pavel
mail/xmpp: p2n-at-ya-dot-ru



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Sysadmins] ssh tunnel
  2009-11-24 15:17     ` Pavel
@ 2009-11-24 15:20       ` Pavel
  2009-11-29 17:50         ` Michael Shigorin
  2009-11-25  7:33       ` Alexander Volkov
  1 sibling, 1 reply; 10+ messages in thread
From: Pavel @ 2009-11-24 15:20 UTC (permalink / raw)
  To: sysadmins

> 1. в sshd_config на сервере_Б д.б.
> GatewayPorts = yes
Прошу прощения, это к делу не относится


-- 
Best regards, Pavel
mail/xmpp: p2n-at-ya-dot-ru



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Sysadmins] ssh tunnel
  2009-11-24 15:17     ` Pavel
  2009-11-24 15:20       ` Pavel
@ 2009-11-25  7:33       ` Alexander Volkov
  1 sibling, 0 replies; 10+ messages in thread
From: Alexander Volkov @ 2009-11-25  7:33 UTC (permalink / raw)
  To: sysadmins

On 2009-11-24 19:17:26 +0400, Pavel wrote:
P> Hello, Alexander Volkov. On 24.11.2009 18:14 you wrote,
P> > Однако попробовал - не вышло на внешний тырфейс повиснуть: 
P> Если я правильно понял вашу задачу, то:
P> 1. в sshd_config на сервере_Б д.б.
P> GatewayPorts = yes
Таки почитал man и поставил clientcpecified
P> 2. с сервера_Б коннектимся по ssh на сервер_А, пробрасывая
P> локальный порт_Б на сервер_А:порт_А
Нет, этот вариант недоступен. Можно только с Сервер_А на Сервер_Б, но не
наоборот.
Поэтому использую -R
P> ssh  -L сервер_Б:порт_Б:сервер_А:порт_А  сервер_А
P> 3. клиентом_В коннектимся к серверу_Б:порт_Б и попадаем на
P> сервер_А:порт_А

Надо таки будет проверить, пока неколи было...

--
 Regards, Alexander



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Sysadmins] ssh tunnel
  2009-11-24 15:20       ` Pavel
@ 2009-11-29 17:50         ` Michael Shigorin
  0 siblings, 0 replies; 10+ messages in thread
From: Michael Shigorin @ 2009-11-29 17:50 UTC (permalink / raw)
  To: sysadmins

On Tue, Nov 24, 2009 at 07:20:16PM +0400, Pavel wrote:
> > 1. в sshd_config на сервере_Б д.б.
> > GatewayPorts = yes
> Прошу прощения, это к делу не относится

Это как раз и относится, только вот так:

---
GatewayPorts clientspecified
--- /etc/openssh/sshd_config

PS: нет, не -g.

-- 
 ---- WBR, Michael Shigorin <mike@altlinux.ru>
  ------ Linux.Kiev http://www.linux.kiev.ua/


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-11-29 17:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-11-24 13:47 [Sysadmins] ssh tunnel Alexander Volkov
2009-11-24 14:07 ` Pavel
2009-11-24 14:14   ` Alexander Volkov
2009-11-24 15:17     ` Pavel
2009-11-24 15:20       ` Pavel
2009-11-29 17:50         ` Michael Shigorin
2009-11-25  7:33       ` Alexander Volkov
2009-11-24 14:09 ` Alexey I. Froloff
2009-11-24 14:19   ` Alexander Volkov
2009-11-24 15:15     ` Alexey I. Froloff

ALT Linux sysadmins discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sysadmins/0 sysadmins/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 sysadmins sysadmins/ http://lore.altlinux.org/sysadmins \
		sysadmins@lists.altlinux.org sysadmins@lists.altlinux.ru sysadmins@lists.altlinux.com
	public-inbox-index sysadmins

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sysadmins


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git