记录这个是为了以后跑路卸载准备的,程序作者没有提供卸载的工具(其实安装的时候,/tmp
下有一个denyHosts_files.log
,里面有安装的文件记录,但是我当时不知道,现在找不到了,参见GitHub的issue),所以就自己边配置边记录。OS:Ubuntu 16.04.7 LTS
- /usr/local/bin
- daemon-control # 守护程序控制脚本,启动入口
- daemon-control-dist
- denyhosts.py
- /usr/local/lib/python2.7/dist-packages
- DenyHosts/
- DenyHosts-3.0.egg-info
- /usr/local/denyhosts/
- denyhosts-3.0/ # 解压路径
- /usr/share/man/man8
- denyhosts.8
- /var/lib/denyhosts # 此路径是由
denyhosts.conf
中的WORK_DIR
配置的- allowed-hosts # 允许的ip,自己配的,详见官方文档
- hosts # (此文件及以下该目录的文件是程序运行一段时间后生成的)
- hosts-restricted
- hosts-root
- hosts-valid
- offset
- purge-history
- suspicious-logins
- users-hosts
- users-invalid
- users-valid
- /etc/
- denyhosts.conf # 配置文件,需要自己逐条设置,注释写的很通俗易懂
- /var/run/
- denyhosts.pid # 单例进程锁
运行成功与否主要看/etc/hosts.deny
有没有记录,以及/var/lib/denyhosts
(WORK_DIR
)下有没有新增一些文件。
安装与启动方法详见GitHub
附上安装日志,可追溯文件动向,因系统而异
root@ubuntu:/usr/local/denyhosts/denyhosts-3.0# python setup.py install
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/allowedhosts.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/sync.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/deny_hosts.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/version.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/counter.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/purgecounter.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/denyfileutil.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/lockfile.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/loginattempt.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/filetracker.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/daemon.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/__init__.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/regex.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/report.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/util.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/plugin.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/constants.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/prefs.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/restricted.py -> build/lib.linux-x86_64-2.7/DenyHosts
copying DenyHosts/python_version.py -> build/lib.linux-x86_64-2.7/DenyHosts
running build_scripts
creating build/scripts-2.7
copying and adjusting denyhosts.py -> build/scripts-2.7
copying and adjusting daemon-control-dist -> build/scripts-2.7
changing mode of build/scripts-2.7/denyhosts.py from 644 to 755
changing mode of build/scripts-2.7/daemon-control-dist from 644 to 755
running install_lib
creating /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/allowedhosts.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/sync.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/deny_hosts.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/version.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/counter.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/purgecounter.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/denyfileutil.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/lockfile.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/loginattempt.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/filetracker.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/daemon.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/__init__.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/regex.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/report.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/util.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/plugin.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/constants.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/prefs.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/restricted.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
copying build/lib.linux-x86_64-2.7/DenyHosts/python_version.py -> /usr/local/lib/python2.7/dist-packages/DenyHosts
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/allowedhosts.py to allowedhosts.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/sync.py to sync.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/deny_hosts.py to deny_hosts.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/version.py to version.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/counter.py to counter.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/purgecounter.py to purgecounter.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/denyfileutil.py to denyfileutil.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/lockfile.py to lockfile.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/loginattempt.py to loginattempt.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/filetracker.py to filetracker.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/daemon.py to daemon.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/__init__.py to __init__.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/regex.py to regex.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/report.py to report.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/util.py to util.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/plugin.py to plugin.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/constants.py to constants.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/prefs.py to prefs.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/restricted.py to restricted.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/DenyHosts/python_version.py to python_version.pyc
running install_scripts
copying build/scripts-2.7/daemon-control-dist -> /usr/local/bin
copying build/scripts-2.7/denyhosts.py -> /usr/local/bin
changing mode of /usr/local/bin/daemon-control-dist to 755
changing mode of /usr/local/bin/denyhosts.py to 755
running install_data
copying denyhosts.conf -> /etc
copying denyhosts.8 -> /usr/share/man/man8
running install_egg_info
Writing /usr/local/lib/python2.7/dist-packages/DenyHosts-3.0.egg-info