LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-15-2010, 11:36 PM   #1
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Rep: Reputation: 39
warning: /etc/hosts.deny, line 20: missing ":" separator


Hi,
I am getting a warning from /etc/hosts.deny
Code:
ALL: 192.168.1.3
ALL: 172.68.11.204
Have only the above line in /etc/hosts.deny
Code:
warning: /etc/hosts.deny, line 20: missing ":" separator
What should I look for?

Last edited by tkmsr; 05-15-2010 at 11:48 PM.
 
Old 05-16-2010, 01:15 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Are you saying that your hosts.deny has only two lines?

Which program is producing the error message?
 
Old 05-16-2010, 01:20 AM   #3
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Original Poster
Rep: Reputation: 39
Yest hosts.deny has only two lines.
/var/log/auth.log
I see above error message.
I have put it up to block all programs from those IPs.Right now only ssh is running.But when I will run more I want to block ALL for those IPs.

Last edited by tkmsr; 05-16-2010 at 01:21 AM.
 
Old 05-16-2010, 01:31 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Thanks for information. Do you know which event is triggering the message in /var/log/auth.log?

Last edited by catkin; 05-16-2010 at 01:32 AM. Reason: Added missing ?
 
Old 05-16-2010, 01:56 AM   #5
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Original Poster
Rep: Reputation: 39
It says in beginning of warning
Code:
May 16 07:17:44 homeserver sshd[31735]: warning: /etc/hosts.deny, line 20: missing ":" separator
So I infer that some one trying to do an SSH is what is triggering it.
What else do I need to check let me know and how exactly to get rid of it?I did searched but could not find any thing useful.Is there a possibility that a root kit is there in my system?
I also see a line
Code:
CRON[31833]: pam_unix(cron:session): session opened for user root by (uid=0)
It has filled up my entire log.
Can it be a possible break in?
Is there an elegant way to stop this,
Code:
crontab -l
no crontab for root
As far as I understand that when cron runs
cron has to be authenticated to the system just like everyone else and cron checks the config files to see if anything has changed. Since cron can run at any minute of the day you will see alot of them.
But I just want to make sure that this is happening.

Last edited by tkmsr; 05-16-2010 at 02:19 AM.
 
Old 05-16-2010, 05:01 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
I have no idea what may be the cause and have seen no such messages (my Slackware 13.0 system does not have pam, it does not run sshd and has /var/log/security instead of /var/log/auth.log) so the only thing I can do is ask more questions to build a full picture.

Does the "warning: /etc/hosts.deny, line 20: missing ":" separator" appear more than once? Regards getting rid of the message it would help if you could reproduce it. Are you able to ssh into the system to see if that reproduces it? If so you could stop sshd and start it from the command line with a -d option to get more information.

When you write "So I infer that some one trying to do an SSH is what is triggering it" does that mean it was not you? If it was not you, where could the ssh have come from in network terms? Does this computer have a public address on the Internet or is there a firewall and/or NATing router between it and the Internet? Is it on a LAN with several users?

Regards "Is there a possibility that a root kit is there in my system?", of course it is possible but it may not be likely and we don't yet (AFAIK -- a rootkit expert may know different) have evidence for it.

Finally, which distro and version is the computer running?
 
Old 05-16-2010, 09:26 AM   #7
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Original Poster
Rep: Reputation: 39
[QUOTE=catkin;3970357]I have no idea what may be the cause and have seen no such messages (my Slackware 13.0 system does not have pam, it does not run sshd and has /var/log/security instead of /var/log/auth.log) so the only thing I can do is ask more questions to build a full picture.
[quote]
Ok please go ahead.I will try to answer.
Quote:
Originally Posted by catkin View Post
Does the "warning: /etc/hosts.deny, line 20: missing ":" separator" appear more than once?
Yes
Quote:
Originally Posted by catkin View Post
Regards getting rid of the message it would help if you could reproduce it. Are you able to ssh into the system to see if that reproduces it?
I am able to SSH.
Quote:
Originally Posted by catkin View Post
If so you could stop sshd and start it from the command line with a -d option to get more information.
Code:
Restarting OpenBSD Secure Shell server: sshddebug1: sshd version OpenSSH_5.1p1 Debian-5
debug1: read PEM private key done: type RSA
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: private host key: #0 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024
debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024
debug1: private host key: #1 type 2 DSA
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-d'
debug1: Bind to port 22 on ::.
Server listening on :: port 22.
debug1: Bind to port 22 on 0.0.0.0.
Server listening on 0.0.0.0 port 22.
Well I had installed BlockHosts-2.0.5
just after your last message.
Quote:
Originally Posted by catkin View Post
When you write "So I infer that some one trying to do an SSH is what is triggering it" does that mean it was not you? If it was not you, where could the ssh have come from in network terms? Does this computer have a public address on the Internet
Yes it is on a public IP.All attacks came from 2 specific IPs.Being an open forum I do not want to put them here.
Quote:
Originally Posted by catkin View Post
Regards "Is there a possibility that a root kit is there in my system?", of course it is possible but it may not be likely and we don't yet (AFAIK -- a rootkit expert may know different) have evidence for it.

Finally, which distro and version is the computer running?
Debian Lenny kernel 2.6.26-2-xen-amd64 x86_64 GNU/Linux
 
Old 05-16-2010, 11:36 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Thanks for all that. One thing I forgot to write was, after starting sshd from the command line, to ssh into the server yourself; I was hoping to get a clue about why the error message was triggered.

In view of the fact that the server is on a public IP and the strangeness of the hosts.deny error message (line 20 of a two line file!?) you could ask the moderators to move this thread to the Security forum where it is more likely to attract the attention of experts in this area. You can do so by using the Report button.
 
Old 05-16-2010, 12:06 PM   #9
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Original Poster
Rep: Reputation: 39
Yes I have requested as you said.
 
Old 05-17-2010, 03:51 PM   #10
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Moved to Security per the request of the OP.
 
Old 05-17-2010, 05:23 PM   #11
frndrfoe
Member
 
Registered: Jan 2008
Distribution: RHEL, CentOS, Ubuntu
Posts: 379

Rep: Reputation: 38
Quote:
Server listening on :: port 22.
perhaps turn off ip v6 in the sshd daemon? maybe some weird artifact coming from that.
 
Old 05-17-2010, 05:44 PM   #12
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by tkmsr
Have only the above line in /etc/hosts.deny
Code:
warning: /etc/hosts.deny, line 20: missing ":" separator
What should I look for?
Please post the output of:
Code:
cat -n /etc/hosts.deny
 
Old 05-17-2010, 11:07 PM   #13
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Original Poster
Rep: Reputation: 39
Code:
 1	# /etc/hosts.deny: list of hosts that are _not_ allowed to access the system.
     2	#                  See the manual pages hosts_access(5) and hosts_options(5).
     3	#
     4	# Example:    ALL: some.host.name, .some.domain
     5	#             ALL EXCEPT in.fingerd: other.host.name, .other.domain
     6	#
     7	# If you're going to protect the portmapper use the name "portmap" for the
     8	# daemon name. Remember that you can only use the keyword "ALL" and IP
     9	# addresses (NOT host or domain names) for the portmapper, as well as for
    10	# rpc.mountd (the NFS mount daemon). See portmap(8) and rpc.mountd(8)
    11	# for further information.
    12	#
    13	# The PARANOID wildcard matches any host whose name does not match its
    14	# address.
    15	
    16	# You may wish to enable this to ensure any programs that don't
    17	# validate looked up hostnames still leave understandable logs. In past
    18	# versions of Debian this has been the default.
    19	## ALL: PARANOID
    20	ALL: 211.43.204.42
    21	ALL: 218.67.246.61
    22	ALL: 115.238.71.37
 
Old 05-18-2010, 05:14 AM   #14
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Possible things to think about

1. it doesn't like the blank line at line 15?
2. there's a hidden char (maybe msdos derived) on line 20; try hexdump cmd
3. try deleting the file and just create a new one with only the active lines
 
Old 05-18-2010, 06:30 AM   #15
slimm609
Member
 
Registered: May 2007
Location: Chas, SC
Distribution: slackware, gentoo, fedora, LFS, sidewinder G2, solaris, FreeBSD, RHEL, SUSE, Backtrack
Posts: 430

Rep: Reputation: 67
post the output of cat -A /etc/hosts.deny
 
  


Reply



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
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 03:07 PM
Video Card Nvidia Driver Xlib: extension "GLX" missing on display ":0.0". HELP! badgerbox76 Linux - Newbie 35 03-08-2007 02:27 AM
Video Card Nvidia Driver Xlib: extension "GLX" missing on display ":0.0". badgerbox76 Linux - Games 13 01-11-2006 04:47 PM
ignoring the "non-portable whitespace encountered at line " warning Jake13 Linux - Software 3 08-18-2004 12:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:53 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