리눅스

본문 바로가기
사이트 내 전체검색


리눅스
리눅스

3. denyhosts 설치하기

페이지 정보

작성자 관리자 댓글 1건 조회 4,281회 작성일 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


[root@localhost ~]# chkconfig denyhosts on
[root@localhost ~]# service denyhosts start 


댓글목록

관리자님의 댓글

관리자 작성일

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


개인정보취급방침 서비스이용약관 모바일 버전으로 보기 상단으로

TEL. 063-469-4551 FAX. 063-469-4560 전북 군산시 대학로 558
군산대학교 컴퓨터정보공학과

Copyright © www.leelab.co.kr. All rights reserved.