LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-19-2015, 07:09 AM   #1
jojanmpaul
Member
 
Registered: Sep 2012
Location: Bangalore
Posts: 80

Rep: Reputation: Disabled
Could not open connection to the host, on port 25 Ubuntu


Hello,

I am not able to do telnet from local machine to the server, but able to ping and ssh. I am not able to send mail using smtp mail server install on the server. Please suggest me on the same.

C:\Users\Jojan>telnet 191.167.1.171 25
Connecting To 192.168.1.145...Could not open connection to the host, on port 25:
Connect failed

root@portal:~# telnet localhost 25
Trying ::1...
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 portal.ussoftwaregroup.com ESMTP Sendmail 8.14.4/8.14.4/Debian-4.1ubuntu1; Mon, 19 Oct 2015 16:29:56 +0530; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1]

netstat -tlnp | grep 25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 7354/sendmail: MTA:
 
Old 10-19-2015, 09:06 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,043
Blog Entries: 14

Rep: Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212Reputation: 1212
On the host you're trying to reach run "lsof -i :25" to see what is LISTENing on port 25. Verify it shows either * or the specific IP/hostname on this host that you're using for inbound connections LISTENing. (The * means it is LISTENing on all interfaces.)

Since you say it worked from localhost but not from an external system the most likely issue is that you don't have port 25 open in your firewall at host level (e.g. iptables or firewalld). If you have a firewall device between the two hosts you'd also want to make sure the port is open in that device as well.

Typically your host level firewall allows outbound connections by default but controls inbound though you can even lock outbound.
 
1 members found this post helpful.
Old 10-19-2015, 08:09 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,411

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
By default (for security) sendmail installs to only listen on localhost (as shown by your netstat cmd). Use this http://www.cyberciti.biz/tips/sendma...ions-from.html to enable listening on all interfaces.
 
1 members found this post helpful.
  


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
MobaXterm connect to host port 22: Connection timed out redhatwannabe General 0 11-07-2012 08:41 PM
ssh: connect to host port 22: Connection refused nileshraut2009 Ubuntu 1 10-08-2012 06:40 AM
ssh: connection to host port: 22: Connection timed out lost connection cucolin@ Linux - Server 4 11-22-2011 07:15 AM
ssh: connect to host port 22: Connection timed out shogun1234 Linux - Networking 1 06-21-2011 01:07 PM
ssh: connect to host XXXX port 22: Connection timed out jv2112 Linux - Newbie 3 07-04-2010 05:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:25 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration