LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-28-2004, 12:24 AM   #1
herron
LQ Newbie
 
Registered: Apr 2003
Posts: 4

Rep: Reputation: 0
port forwarding to a linux server's sendmail


In my office I am running a linux server with RH AS just installed. This server runs sendmail and sshd. If I am logged into the machine, sendmail runs fine. It does not relay, of course.

From a machine at home I want to use the linux server's sendmail in a secure way to relay.

So, as root, I do the following

ssh -v -N -L 25:SERVERIP:25 myuserid@SERVERIP

I am then prompted for my server's password. This yields

debug1: Authentication succeeded (password).
debug1: Connections to remote port 25 forwarded to local address SERVERIP:25

This seems fine.

I then tell my local mail client to send mail to port 25 on localhost. But, the ssh log shows the following when I send mail from the remote client:

debug1: channel 2: new [direct-tcpip]
channel 2: open failed: connect failed: Connection refused
debug1: channel_free: channel 2: direct-tcpip: listening port 25 for SERVERIP port 25, connect from ::1 port 58111, nchannels 3

Can anyone help on this? I have no idea what port 58111 is doing here, and I suspect this is causing the problem.

Thanks!
 
Old 02-28-2004, 03:17 AM   #2
linuxxed
Member
 
Registered: Feb 2004
Posts: 273

Rep: Reputation: 30
Re: port forwarding to a linux server's sendmail

Quote:
Originally posted by herron

ssh -v -N -L 25:SERVERIP:25 myuserid@SERVERIP

Your command should be

ssh -L 25:localhost:25 myuserid@SERVERIP

you are creating a socket 25 on local host to forward it to remote serverip on 25.

After this debug like

telnet localhost 25

telnet serverip 25

you should see smtp welcome message.


It should be worth noting that your connection is encrypted between home and office but the mail going out from your sendmail would be unencrypted.


[ Ideally you should build TLS support on your sendmail and authenticate people who want to relay through your sendmail ]


hope this helps.
 
Old 02-28-2004, 07:18 PM   #3
herron
LQ Newbie
 
Registered: Apr 2003
Posts: 4

Original Poster
Rep: Reputation: 0
Thanks! That did the trick.

mh
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 12:08 PM
port forwarding to linux, not reaching it retinaburn Linux - Networking 16 08-30-2004 09:37 PM
SoF2 Linux Server and Port Forwarding adskiremote Linux - Games 0 07-30-2004 04:15 AM
Netgear MR814 - Port Forwarding with linux?? rEph Linux - Networking 6 02-10-2003 10:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration