On Tue, 26 Jun 2007 23:26:02 +0200, wiso wrote:
>>>>> K. Jennings wrote:
>>>>>
>>>>>
>>>>>> To summarize:
>>>>>>
>>>>>> Machine pc0 is in the Internet.
>>>>>>
>>>>>> Machine pc1 is in the Internet.
>>>>>>
>>>>>> pc0 can get into pc1 via SSH.
>>>>>>
>>>>>> pc1 can access pc2 via SSH.
>>>>>>
>>>>>> pc2 is not directly accessible from pc0.
>>>>>
>>>>> ok
>>>>>> pc2 is listening for incoming SSH connections at port (say)
>>>>>> 222.
>>>>>
>>>>>
>> Try with the following .ssh/config file:
>>
>> Host pc1
>> HostName <IP address of pc1 as seen from pc0> HostKeyAlias pc1
>> User <Your user name in pc1>
>> Port <Port number at which pc1 is listening for incoming SSH
>> connections>
>>
>> Host pc2
>> HostName localhost
>> HostKeyAlias pc2
>> User <Your user name in pc1>
>> Port <First port number used in the ssh -fngT command>
>
> I ask you to be patient one more time... this is my ./ssh/config on my
> computer (pc0):
>
> Host moby
> HostName moby.mib.infn.it
> HostKeyAlias moby.mib.infn.it
> User turra
> Port 22
>
> Host crio
> HostName localhost
> HostKeyAlias crio
> User turra
> Port 3022
>
> pc1 is moby, pc2 is crio
>
> I try:
> ssh -fngT -L 3022:turra@crio:222 -C (E-Mail Removed) ping -i 30
> localhost > /dev/null 2>&1
>
> and I get:
> (E-Mail Removed)'s password:
> ok
>
> I try:
> ssh crio
> and I get:
> channel 2: open failed: connect failed: Connection refused
> ssh_exchange_identification: Connection closed by remote host
Maybe you should change your .ssh/config file to read as follows:
Host moby
HostName moby.mib.infn.it
HostKeyAlias moby
User turra
Host crio
HostName localhost
HostKeyAlias crio
User turra
Port 3022
This aside, I think that what is happening is that crio is not
listening for incoming SSH connections at port 222. Chances are that it
is listening on the standard port 22, but you'll have to find out.
Anyway, assuming it is 22 indeed, and that you changed .ssh/config as
above you should try the following:
ssh -fngT -L 3022:crio:22 -C moby ping -i 30 localhost > /dev/
null 2>&1
After typing your password at the prompt that you should get,
executing
ssh crio
should elicit crio's password prompt - assuming, of course, that crio
supports password authentication. If you install your relevant public
keys in moby and crio, you'll be able to get in without typing a password.