My secure log (below) seems to indicate that someone is trying to hack into one of my Linux servers.
I only have my Linux workstation's SSH port forwarded through my hardware firewall router. The other server (the church one) does not have anything except the HTTP port (and a non-standard one at that) forwarded.
I will probably change my root password. I only have five user accounts on the Linux workstation (non of which are root equivalents).
What else should I do? Can I change the configuration of SSH to prevent repeated attempts from the same IP address?
I've been researching sshd and allowing/denying access and I think I have figured it out. Just please confirm that I'm on the right track.
I edited my hosts.allow as follows:
# # hosts.allow This file describes the names of the hosts which are # allowed to use the local INET services, as decided # by the '/usr/sbin/tcpd' server. # sshd: localhost 192.168.0.0/255.255.255.0 12.30.163.*
And then my hosts.deny as follows:
# # 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 : ALL
However, I don't really have anyway to test this as I allowed access from everywhere that I am. :)
Any suggestions and advice is still greatly appreciated.
On Thu, 21 Oct 2004 09:03:19 -0400 (EDT) "Jon Moss" jon.moss@cnonline.net wrote:
I've been researching sshd and allowing/denying access and I think I have figured it out. Just please confirm that I'm on the right track.
I edited my hosts.allow as follows:
# # hosts.allow This file describes the names of the hosts which are # allowed to use the local INET services, as decided # by the '/usr/sbin/tcpd' server. # sshd: localhost 192.168.0.0/255.255.255.0 12.30.163.*
And then my hosts.deny as follows:
# # 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 : ALL
However, I don't really have anyway to test this as I allowed access from everywhere that I am. :)
Any suggestions and advice is still greatly appreciated.
Yes that is what you want to do to restrict SSH access.
--------------------------------- Frank Wiles frank@wiles.org http://www.wiles.org ---------------------------------
-----Original Message----- From: kclug-bounces@kclug.org [mailto:kclug-bounces@kclug.org] On Behalf Of Matt Graham Sent: Thursday, October 21, 2004 10:10 AM To: kclug@kclug.org Subject: Re: It was bound to happen - suspected hack Where does one find a security log on their system, and how does one monitor it for possible problems?
Have a look at the contents of /var/log, particularly: messages secure maillog
You can peruse them with something like: less /var/log/messages
Hope that gets you started - there are complete volumes of information one should acquaint themselves with if really serious.
D.
Quoting Matt Graham linux@bizniche.com:
My secure log (below) seems to indicate that someone is trying to hack into one of my Linux servers.
Where does one find a security log on their system, and how does one monitor it for possible problems?
On Red Hat systems, /var/log/secure. Red Hat also comes with a logrotate system that rotates the logs weekly and keeps the old ones around for 4 weeks. And there's a logwatch application that will send unusual or previously unseen entries to the root account. I'm sure all of this is highly configurable, but the default setup has been fine for my needs.
-- Dave Hull http://insipid.com
Different distributions have different security measures enabled by default. There are several other things you can do in addition to the hosts.allow/deny you've already setup. You can configure sshd to not allow root login from ssh. You can also setup your system to only allow a certain user (or users) to use su, which helps 'limit liability' if a users account is compromised. And why is /var/log/lastlog missing on your system? does wtmp still exist? I'd be sure to run the most recent version of chkrootkit on your system, and the small myriad of other rootkit checkers that are out there (to lazy to google it myself at the moment ;-) )
On Thu, 21 Oct 2004 08:14:06 -0400 (EDT), Jon Moss jon.moss@cnonline.net wrote:
My secure log (below) seems to indicate that someone is trying to hack into one of my Linux servers.
I only have my Linux workstation's SSH port forwarded through my hardware firewall router. The other server (the church one) does not have anything except the HTTP port (and a non-standard one at that) forwarded.
I will probably change my root password. I only have five user accounts on the Linux workstation (non of which are root equivalents).
What else should I do? Can I change the configuration of SSH to prevent repeated attempts from the same IP address?
I will find chkrootkit and the other utilities you mentioned and check them out.
I wondered about the lastlog error also. I will research it as well.
I thought I could configure ssh to prevent root access (I never login root remotely anyway). I will also limit su to a single user.
Thanks again for the great information.
Jon
Different distributions have different security measures enabled by default. There are several other things you can do in addition to the hosts.allow/deny you've already setup. You can configure sshd to not allow root login from ssh. You can also setup your system to only allow a certain user (or users) to use su, which helps 'limit liability' if a users account is compromised. And why is /var/log/lastlog missing on your system? does wtmp still exist? I'd be sure to run the most recent version of chkrootkit on your system, and the small myriad of other rootkit checkers that are out there (to lazy to google it myself at the moment ;-) )
On Thu, 21 Oct 2004 08:14:06 -0400 (EDT), Jon Moss jon.moss@cnonline.net wrote:
My secure log (below) seems to indicate that someone is trying to hack into one of my Linux servers.
I only have my Linux workstation's SSH port forwarded through my hardware firewall router. The other server (the church one) does not have anything except the HTTP port (and a non-standard one at that) forwarded.
I will probably change my root password. I only have five user accounts on the Linux workstation (non of which are root equivalents).
What else should I do? Can I change the configuration of SSH to prevent repeated attempts from the same IP address?
This message was scanned by GatewayDefender 11:48:19 AM ET - 10/21/2004