Discussion: going from A to B
Afficher un message
Vieux 04/10/2006, 17h40   #3
Frank W. Steiner
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: going from A to B

On Wed, 04 Oct 2006 15:56:56 +0000, Greg Hennessy wrote:

> My work requires us to ssh into a certain machine (A) and then we can ssh
> to a more normal workstation (B), where B isn't visible past teh firewall.
> Is there a way to forward or redirect (whatever the proper term is) so I
> can do this in one shot?


In case this is the setup that you have in mind:

Machine M1 is in the Internet.

Machine M2 is in the Internet.

Machine M3 is not in the Internet, but it is in some private network
N that M2 is connected to.

M1 can get into M2 via SSH.

M2 can access M3 via SSH in N.

M3 is not directly accessible from M1 (because M3 is not in the
Internet).

M3 is listening for incoming SSH connections at port (say) 222 in
N.

In order to SSH into M3 from M1 we do the following on M1
(assuming that the SSH software used is OpenSSH):

ssh -fngT -L 3022:M3:222 -C M2 ping -i 30 localhost > /dev/null
2>&1

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

Host M3
HostName localhost
HostKeyAlias M3
User Username on M3
Port 3022

then we can get from M1 to M3 by means of

ssh M3

  Réponse avec citation
 
Page generated in 0,04444 seconds with 9 queries