LINUX.ORG.RU
ФорумAdmin

ssh ??? расшарить соединение ???


0

0

можно реализовать что-нибудь такое??
client соединяется по ssh с сервером, вводит пароль или по ключу.
сервер использует это подключение и выполняет на клиенте нужные ему действия без ввода пароля или ключа...
★★

Re: ssh ??? расшарить соединение ???

mogno poprobovat'
Setting up a reverse tunnel

From the internal system, use SSH+ProxyTunnel to set up a reverse tunnel that connects some remote port on the remote system to port 23 (telnet) of a local system:

muppet@runabout:/home/muppet $ ssh -R 2323:some-sys.bigacme.com:23 casa

From this moment one, everybody who can log on the remote system casa (actually a system called swamp, a.k.a. www.muppetzone.com) can telnet to port 2323 on that local system and be patched through to port 23 (the telnet server port) of some-sys.bigacme.com, a system inside the BigAcme corporate firewall! Mind you, we have now created a setup through which we can telnet straight through the corporate firewall into a local BigAcme system!

muppet@swamp:/home/muppet $ telnet localhost 2323
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.

HP-UX some-sys B.11.00 U 9000/811 (tb)

login: muppet
password:
Last login: Fri Mar 22 14:29:05 2002 from localhost

(c)Copyright 1983-1997 Hewlett-Packard Co., All Rights Reserved.
(c)Copyright 1979, 1980, 1983, 1985-1993 The Regents of the Univ. of California
(c)Copyright 1980, 1984, 1986 Novell, Inc.
(c)Copyright 1986-1992 Sun Microsystems, Inc.
(c)Copyright 1985, 1986, 1988 Massachusetts Institute of Technology
(c)Copyright 1989-1993 The Open Software Foundation, Inc.
(c)Copyright 1986 Digital Equipment Corp.
(c)Copyright 1990 Motorola, Inc.
(c)Copyright 1990, 1991, 1992 Cornell University
(c)Copyright 1989-1991 The University of Maryland
(c)Copyright 1988 Carnegie Mellon University
(c)Copyright 1991-1997 Mentat, Inc.
(c)Copyright 1996 Morning Star Technologies, Inc.
(c)Copyright 1996 Progressive Systems, Inc.
(c)Copyright 1997 Isogon Corporation

$ uname
HP-UX
$ exit

The connection now flows back through the reverse tunnel into the telnet port of some-sys.bigacme.com:

telnetd telnet program
^ |
| V
+ --------
+---+---+ / port \
| port | | 2323 |
| 23 | +---+----+
\-----/ |
^ |
| some-sys |
---------+---------- |
| runabout |
| V
+-----+------+ +------------+
| | | |
| SSH client <-+ +---+ SSH daemon |
| | | | | |
+------------+ | | +------------+
| |
| +------+
+-----+-----+ +---------+ |
| | | | |
| Proxy | | Proxy | |
| Tunnel | +---------+ |
| <-------------<-tunnel--<--+
| | +---------+
+-----------+ | |
+---------+

anonymous ()

Re: ssh ??? расшарить соединение ???

На клиенте:
netcat -p 7777 -s localhost -l | /bin/bash
ssh -C -R7777:localhost:7777 user@server.com

На сервере (server.com):
cat shell_commands | netcat localhost 7777
           (выполняется на клиенте)

sdio ★★★★★ ()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.