Find the answer to your Linux question:
Results 1 to 2 of 2
I'm trying to set up an SSH tunnel to allow myself to use an SMTP server which is behind a firewall. I have an SSH server also behind the firewall ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2008
    Posts
    1

    SSH Tunneling for Email


    I'm trying to set up an SSH tunnel to allow myself to use an SMTP server which is behind a firewall. I have an SSH server also behind the firewall that has access to the SMTP server.

    So, I ran this command:
    ssh -C -f user@ssh_server_ip -L 25:mail_server_ip:25
    It asks me for my ssh user's password. I enter it an it appears to work.

    Then, I do a telnet mail_server_ip 25 and I get this:
    220 relay.wanderingwifi.com ESMTP (99ec4d3757fa03f4260acf938ff158fa)

    I'm at a Caribou and obviously behind a proxy. Am I not going to be able to get this to work?

  2. #2
    Linux Enthusiast
    Join Date
    Apr 2004
    Location
    UK
    Posts
    712
    If I understand the network layout correctly, if you don't run ssh and do the telnet command then you will get the same thing. Is that correct?

    Try "telnet localhost 25" after setting up the tunnel. What the -L option does is open a port on your own computer that routes incoming traffic out on the ssh server aimed at the IP specified in the option. To take advantage of that tunnel you have to connect your programs to localhost.

    What is a Caribou?

    Let us know how you get on,

    Chris...
    To be good, you must first be bad. "Newbie" is a rank, not a slight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •