Help - Search - Members - Calendar
Full Version: hosts.deny giving error, "warning: /etc/hosts.deny, line 22: missing newline or line"
The Planet Forums > Operating Systems > Red Hat Linux > Red Hat HOWTOs
Worry-Free
Hello,

I'm trying to use hosts.deny to block people who try to gain access to my Ensim server. The hosts.deny file contents is here:

------------------------------------------------------------------
#
# hosts.deny This file describes the names of the hosts which are
# *not* allowed to use the local INET services, as decided
# by the '/usr/sbin/tcpd' server.
#
# The portmap line is redundant, but it is left to remind you that
# the new secure portmap uses hosts.deny and hosts.allow. In particular
# you should know that NFS uses portmap!

ALL: 195.39.77.72
ALL: 203.197.163.88
ALL: 209.197.234.4
ALL: 211.72.32.14
ALL: 212.63.71.100
ALL: 216.69.173.150
ALL: 217.160.164.50
ALL: 220.130.245.95
ALL: 60.248.115.160
ALL: 80.53.95.206
ALL: 213.237.119.141
ALL: 217.26.52.16
ALL: 72.14.76.3
----------------------------------------------------------------------

The error message I get in in Logwatch is here:
warning: /etc/hosts.deny, line 22: missing newline or line too long

What am I doing wrong?
dynamicnet
Greetings:

Did you check what you have between lines 20 and 24 inclusive?

BTW, you can vi right to a line number such as


vi +22 /etc/hosts.deny


Thank you.
ntburchf
QUOTE (Worry-Free)
Hello,

I'm trying to use hosts.deny to block people who try to gain access to my Ensim server. The hosts.deny file contents is here:

------------------------------------------------------------------
CODE
#

# hosts.deny    This file describes the names of the hosts which are

#  *not* allowed to use the local INET services, as decided

#  by the '/usr/sbin/tcpd' server.

#

# The portmap line is redundant, but it is left to remind you that

# the new secure portmap uses hosts.deny and hosts.allow.  In particular

# you should know that NFS uses portmap!



ALL: 195.39.77.72

ALL: 203.197.163.88

ALL: 209.197.234.4

ALL: 211.72.32.14

ALL: 212.63.71.100

ALL: 216.69.173.150

ALL: 217.160.164.50

ALL: 220.130.245.95

ALL: 60.248.115.160

ALL: 80.53.95.206

ALL: 213.237.119.141

ALL: 217.26.52.16

ALL: 72.14.76.3

----------------------------------------------------------------------

The error message I get in in Logwatch is here:
warning: /etc/hosts.deny, line 22: missing newline or line too long

What am I doing wrong?

unless I'm mistaken,
I don't think you are supposed to have a space after the : on your lines
should look like this
CODE
# you should know that NFS uses portmap!

ALL:195.39.77.72

ALL:203.197.163.88

ALL:209.197.234.4

ALL:211.72.32.14

ALL:212.63.71.100

ALL:216.69.173.150

ALL:217.160.164.50

ALL:220.130.245.95

ALL:60.248.115.160

ALL:80.53.95.206

ALL:213.237.119.141

ALL:217.26.52.16

ALL:72.14.76.3
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.