LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Refusing smtp and telnet connections (https://www.linuxquestions.org/questions/linux-networking-3/refusing-smtp-and-telnet-connections-239833/)

johnsfrj 10-07-2004 09:58 AM

Refusing smtp and telnet connections
 
I'm running a new install of RedHat 9. I am unable to make a remote connection to port 25 nor am I able to telnet into the machine. However, I am able to ping the internal lan address and send mail from the local host. I have disabled the local firewall. What gives????

maxut 10-07-2004 10:27 AM

prefer SSH instead of telnet for security. by the default sendmail smtp daemon listens to only loopback. so u cannot connect to your linux via port 25. u must tell sendmail to listen to all interfaces. if u really want to run telnet. fisr make sure if it works.
run following commands:
#ntsysv
check telnet is on.
#/etc/init.d/xinetd restart


good luck

johnsfrj 10-07-2004 10:53 AM

Telnet in not among the choices. Also, I know that it is refusing smtp connections because I cannot use it to send email from another pc nor can telnet to that address with port 25.

Thanks for any help.

Toxe 10-07-2004 10:56 AM

Maybe something in /etc/hosts.deny that blocks your telnet connections?

johnsfrj 10-07-2004 11:08 AM

There is nothing in the hosts.deny file. I thought maybe I needed to edit the sendmail.mc file by adding the LAN ip address to the DEAMON_OPTIONS entry. Mine currently looks like this:

DEAMON_OPTIONS(`Port=smtp,Name=MTA')dnl

I tried

DAEMON_OPTIONS(`Port=smtp,Addr=192.168.1.5, Name=MTA')dnl

with 192.168.1.5 being the address assigned to the linux machine.

Still, not able to send mail from remote client as well as not accepting anything on port 25.

maxut 10-08-2004 01:27 AM

r u sure about iptables?
check it again pls
#iptables -nvL

good luck

johnsfrj 10-08-2004 08:39 AM

This is what I get.

# iptables -nvL
Chain INPUT (policy ACCEPT 1519K packets, 151M bytes)
pkts bytes target prot opt in out source destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 2490K packets, 213M bytes)
pkts bytes target prot opt in out source destination

maxut 10-08-2004 09:03 AM

hmm..
can u see that sendmail listens to port 25?
#netstat -an|grep tcp|grep 25

also check if sendmail daemon runs
#ps aux

also check /var/log/messages if there is errors about sendmail

good luck.

scowles 10-08-2004 09:36 AM

1) vi /etc/mail/sendmail.mc

2) Look for the following line:
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

3) change the above line to:
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
---or---
you can leave the 127.0.0.1 line and add a second one that references the eth0 address. i.e.
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=192.168.9.3, Name=MTA')dnl

The above is equivelent to commenting the 127.0.0.1 line. i.e. If there is no DAEMON_OPTIONS, then all interfaces are enabled.

4) Save /etc/mail/sendmail.mc after making the above change in step 3

5) Restart sendmail. Since you're using redhat, a new sendmail.cf will be created from sendmail.mc

You should be good to go.

apolinsky 10-08-2004 09:52 AM

If you cannot telnet into a machine it probably means that the telnet daemon is not running on that machine. In many distributions, I think Redhat is one, they split telnet into a two install process. There is the telnet server, which starts the daemon, and the telnet client, which allows you to telnet to another box. Both portions must be installed and enabled, for telnet to work. You will probably also have to configure the file controlling the activity of the daemon. I think it is located in /etc/xinetd.d. There will be a series of files each controlling the activity of one daemon. You would have to edit the one affecting telnetd, the telnet daemon

johnsfrj 10-08-2004 09:55 AM

This is what I get now.

[root@linuxws1 mail]# netstat -an|grep tcp|grep 25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
[root@linuxws1 mail]# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.1 1520 492 ? S Oct06 0:04 init
root 2 0.0 0.0 0 0 ? SW Oct06 0:00 [keventd]
root 3 0.0 0.0 0 0 ? SW Oct06 0:00 [kapmd]
root 4 0.0 0.0 0 0 ? SWN Oct06 0:00 [ksoftirqd/0]
root 7 0.0 0.0 0 0 ? SW Oct06 0:00 [bdflush]
root 5 0.0 0.0 0 0 ? SW Oct06 0:00 [kswapd]
root 6 0.0 0.0 0 0 ? SW Oct06 0:00 [kscand]
root 8 0.0 0.0 0 0 ? SW Oct06 0:00 [kupdated]
root 9 0.0 0.0 0 0 ? SW Oct06 0:00 [mdrecoveryd]
root 13 0.0 0.0 0 0 ? SW Oct06 0:00 [kjournald]
root 69 0.0 0.0 0 0 ? SW Oct06 0:00 [khubd]
root 1033 0.0 0.0 0 0 ? SW Oct06 0:00 [kjournald]
root 1351 0.0 0.2 1568 572 ? S Oct06 0:00 syslogd -m 0
root 1355 0.0 0.1 1504 428 ? S Oct06 0:00 klogd -x
rpc 1381 0.0 0.2 1652 544 ? S Oct06 0:00 portmap
rpcuser 1400 0.0 0.2 1664 596 ? S Oct06 0:00 rpc.statd
root 1469 0.0 0.1 1508 472 ? S Oct06 0:00 /usr/sbin/apmd -p 10 -w 5 -W -P /etc/sysconfig/apm-scripts/apmroot 1507 0.0 0.8 8880 2108 ? S Oct06 0:00 /usr/sbin/snmpd -s -l /dev/null -P /var/run/snmpd -a
root 1518 0.0 0.6 7596 1680 ? S Oct06 0:33 cupsd
root 1551 0.0 0.4 6104 1240 ? S Oct06 1:05 ipp://192.168.1.15/printers/queue1 1 root testprint.ps 1 page-root 1560 0.0 0.4 3564 1072 ? S Oct06 0:00 /usr/sbin/sshd
root 1574 0.0 0.2 2132 680 ? S Oct06 0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid
root 1623 0.0 0.1 1548 428 ? S Oct06 0:00 gpm -t imps2 -m /dev/mouse
root 1632 0.0 0.2 1576 572 ? S Oct06 0:00 crond
xfs 1664 0.0 1.2 4888 3180 ? S Oct06 0:00 xfs -droppriv -daemon
daemon 1673 0.0 0.2 1560 548 ? S Oct06 0:00 /usr/sbin/atd
root 1687 0.0 0.1 1512 400 tty1 S Oct06 0:00 /sbin/mingetty tty1
root 1688 0.0 0.1 1492 396 tty2 S Oct06 0:00 /sbin/mingetty tty2
root 1689 0.0 0.1 1508 400 tty3 S Oct06 0:00 /sbin/mingetty tty3
root 1690 0.0 0.1 1508 396 tty4 S Oct06 0:00 /sbin/mingetty tty4
root 1691 0.0 0.1 1508 400 tty5 S Oct06 0:00 /sbin/mingetty tty5
root 1692 0.0 0.1 1500 396 tty6 S Oct06 0:00 /sbin/mingetty tty6
root 1693 0.0 1.2 14320 3152 ? S Oct06 0:00 /usr/bin/gdm-binary -nodaemon
root 1746 0.0 1.4 14988 3592 ? S Oct06 0:00 /usr/bin/gdm-binary -nodaemon
root 1747 0.0 7.3 89056 18732 ? S Oct06 1:57 /usr/X11R6/bin/X :0 -auth /var/gdm/:0.Xauth vt7
root 1757 0.0 2.2 18548 5724 ? S Oct06 0:00 /usr/bin/gnome-session
root 1823 0.0 0.3 3208 828 ? S Oct06 0:00 /usr/bin/ssh-agent /etc/X11/xinit/Xclients
root 1833 0.0 3.1 12504 7916 ? S Oct06 0:01 /usr/libexec/gconfd-2 5
root 1836 0.0 0.6 6308 1664 ? S Oct06 0:00 /usr/libexec/bonobo-activation-server --ac-activate --ior-outproot 1838 0.0 1.5 17320 4004 ? S Oct06 0:00 gnome-settings-daemon --oaf-activate-iid=OAFIID:GNOME_Settingsroot 1843 0.0 0.3 2708 832 ? S Oct06 0:00 fam
root 1850 0.0 1.9 12960 5072 ? S Oct06 0:04 /usr/bin/metacity --sm-client-id=default1
root 1854 0.0 3.6 21808 9204 ? S Oct06 0:09 gnome-panel --sm-client-id default2
root 1856 0.0 4.2 68668 10840 ? S Oct06 0:06 nautilus --no-default-window --sm-client-id default3
root 1858 0.0 1.4 16008 3620 ? S Oct06 0:00 magicdev --sm-client-id default4
root 1861 0.0 1.7 16820 4504 ? S Oct06 0:00 eggcups --sm-client-id default6
root 1863 0.0 1.2 11716 3248 ? S Oct06 0:00 pam-panel-icon --sm-client-id default0
root 1865 0.0 3.2 24404 8192 ? SN Oct06 0:03 /usr/bin/python /usr/bin/rhn-applet-gui --sm-client-id defaultroot 1866 0.0 0.2 1556 520 ? S Oct06 0:00 /sbin/pam_timestamp_check -d root
root 1872 0.0 1.7 16564 4388 ? S Oct06 0:00 /usr/libexec/notification-area-applet --oaf-activate-iid=OAFIIroot 2299 0.0 0.1 1860 468 ? S Oct06 0:00 esd -terminate -nobeeps -as 2 -spawnfd 22
root 3243 0.0 4.0 23556 10280 ? S Oct07 0:04 gnome-terminal
root 3244 0.0 0.2 1996 516 ? S Oct07 0:00 gnome-pty-helper
root 3245 0.0 0.5 4260 1300 pts/0 S Oct07 0:00 bash
root 3278 0.0 0.9 11300 2472 ? S Oct07 0:00 /usr/bin/redhat-config-services
root 3279 0.0 0.3 4680 992 ? S Oct07 0:00 /usr/sbin/userhelper -w redhat-config-services
root 3280 0.0 0.3 4204 1012 ? S Oct07 0:00 /bin/sh /usr/share/redhat-config-services/redhat-config-servicroot 3281 0.0 3.4 21788 8696 ? S Oct07 0:01 /usr/bin/python /usr/share/redhat-config-services/serviceconf.root 3649 0.7 11.0 103180 28084 ? S 08:33 0:31 /usr/lib/mozilla-1.4/mozilla-bin -UILocale en-US
root 3750 0.0 1.0 6308 2664 ? S 09:46 0:00 sendmail: accepting connections
smmsp 3759 0.0 0.9 6140 2340 ? S 09:46 0:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue
root 3766 0.0 0.2 2724 756 pts/0 R 09:48 0:00 ps aux



Also, I made the changes to the sendmail.mc file and saved by using the command:
# makemap hash /etc/mail/access < /etc/mail/access
# service sendmail restart

Still a no go. Also tried:
# make -C /etc/mail
# service sendmail restart

I must be missing something easy but dang!! Anyway thanks for all of the help!

maxut 10-08-2004 10:21 AM

Quote:

Originally posted by johnsfrj
This is what I get now.

[root@linuxws1 mail]# netstat -an|grep tcp|grep 25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN

sendmail or something listens to 127.0.0.1:25 not other interfaces!

so please follow scowles suggestions

good luck.

scowles 10-08-2004 10:34 AM

Quote:

Also, I made the changes to the sendmail.mc file and saved by using the command:
# makemap hash /etc/mail/access < /etc/mail/access
# service sendmail restart
Huh? You mentioned making changes to sendmail.mc, but rebuilt the access database.
Quote:

Still a no go. Also tried:
# make -C /etc/mail
# service sendmail restart
The redhat sendmail init script runs make -C /etc/mail during a start or restart. So, a new sendmail.cf file will be created along with any database file that changed. i.e. /etc/mail/access

johnsfrj 10-08-2004 11:02 AM

Understood. So after I make the changes to sendmail.mc, what command is required to update prior to
#service sendmail restart

Please understant that I am kinda new to linux and am having to learn fast or drown!

scowles 10-08-2004 11:14 AM

Quote:

Understood. So after I make the changes to sendmail.mc, what command is required to update prior to
#service sendmail restart
None!

# service sendmail restart - will rebuild sendmail.cf and any sendmail database file that was changed.

If you're intersted in howto manually rebuild sendmail.cf from sendmail.mc, like what a "service sendmail start/restart" does...

# cd /etc/mail
# m4 sendmail.mc >sendmail.cf


All times are GMT -5. The time now is 07:22 AM.