Two SSH tunnels

agraboso

Registered
I'm trying to use my university department's SMTP server, but they have it closed for use from outside the building. You cannot even authenticate... But I have access to several Sun machines inside from which I can use it.
From these Sun machines, I can, for example, telnet to port 25 of the host running the SMTP server and actually send a message.

But how to make Mail.app to send emails this way? I tried to forward my local port 5525 to port 25 on any of these Sun machines, hoping this port would talk to port 25 of the SMTP server, but it doesn't work.

I then thought: OK, I forward my local port 5525 to port 5525 on the Sun machine, and then the latter to port 25 on the SMTP server. But the SMTP then requires me PAM authentication!!! I don't even know what this is and my password in the Sun computers doesn't make the job...

Can anyone help me with this f**cking mess? Thanks in advance.

Alberto
 
What command are you using exactly (you can substitute, say "sun.behind.firewall" for the real name for privacy) ? SSH tunnels are the sh•znat and I'm sure we can find a solution...
 
I also posted this question in another forum and got an answer yesterday. The thing is that SSH allows you authenticate in one machine and then access every other trusted machine in the LAN. So, I can SSH to one of the Sun machines and then forward local ports to the SMTP server, which is inside my department's LAN with something like
Code:
ssh -L5525:smtp.mydepartment.myuniversity.edu:25
    -L55143:imap.mydepartment.myuniversity.edu:143
    username@sunmachine.mydepartment.myuniversity.edu
All other examples of port forwarding I had seen before were forwarding local ports to ports in the machine you log in (sunmachine.mydepartment.myuniversity.edu in this case)

Anyway, thanks for the answer and the interest in helping.
 
That's exactly what I was going to suggest. Incidentally, that's how I connect to my router from outside my LAN (I forward from my iMac to my router inside the LAN, and tunnel to my iMac from my iBook on the WAN so I don't have to open the WAN configuration port to intruders ;) then just connect to 127.0.0.1:47800 to see my router over the SSH tunnel ).
 
Back
Top