3. denyhosts 설치하기
페이지 정보
작성자 관리자 댓글 1건 조회 6,335회 작성일 18-11-23 20:06본문
3. denyhosts 설치하기
# yum install epel-release -y
# yum install python-ipaddr -y
# yum install wget git -y
# git clone https://github.com/denyhosts/denyhosts
# cd denyhosts/
[root@localhost denyhosts]# ls
[root@localhost denyhosts]# python setup.py install
[root@localhost denyhosts]# vi denyhosts.service
[Unit]
Description=SSH log watcher
Before=sshd.service
[Service]
Type=forking
ExecStartPre=/bin/rm -f /run/denyhosts.pid
ExecStart=/usr/bin/denyhosts.py --daemon --config=/etc/denyhosts.conf
PIDFile=/run/denyhosts.pid
[Install]
WantedBy=multi-user.target
[root@localhost denyhosts]# cp denyhosts.service /usr/lib/systemd/system/
[root@localhost denyhosts]# vi /etc/denyhosts.conf
# Redhat or Fedora Core:
SECURE_LOG = /var/log/secure
#
# Mandrake, FreeBSD or OpenBSD:
#SECURE_LOG = /var/log/auth.log
#
# SuSE or Gentoo:
#SECURE_LOG = /var/log/messages
#
# Mac OS X (v10.4 or greater -
# also refer to: http://www.denyhost.net/faq.html#macos
#SECURE_LOG = /private/var/log/asl.log
#
# Mac OS X (v10.3 or earlier):
#SECURE_LOG=/private/var/log/system.log
#
# Debian and Ubuntu
#SECURE_LOG = /var/log/auth.log
#
# Jan 1 13:05:59
DAEMON_LOG_TIME_FORMAT = %b %d %H:%M:%S
#
# Jan 1 01:05:59
#DAEMON_LOG_TIME_FORMAT = %b %d %I:%M:%S
#
[root@localhost denyhosts]# cp daemon-control-dist /usr/bin/daemon-control
[root@localhost denyhosts]# vi /usr/bin/daemon-control
DENYHOSTS_BIN = "/usr/bin/denyhosts.py"
DENYHOSTS_LOCK = "/run/denyhosts.pid"
DENYHOSTS_CFG = "/etc/denyhosts.conf"
[root@localhost denyhosts]# systemctl enable denyhosts
[root@localhost denyhosts]# systemctl restart denyhosts
Yum으로 설치하기
[root@localhost ~]# yum install python-ipaddr -y
[root@localhost ~]# yum install https://ftp.tu-chemnitz.de/pub/linux/dag/redhat/el7/en/x86_64/rpmforge/RPMS/denyhosts-2.6-5.el7.rf.noarch.rpm -y
댓글목록
관리자님의 댓글
관리자 작성일
python2에서 pip 설치
# curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
# python get-pip.py
python3에서 pip 설치
# curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
# python get-pip.py
requests 설치
# pip install requests