To see if the SSH service supports Tcpwrapper:
ldd ' which-a sshd ' | grep Wrap
Configuration file:/etc/hosts.allow; /etc/hosts.deny
1. Record log:
Modify/etc/hosts.deny:
Sshd:172.16.20.211:severity Warning #定义日志的级别为warning
Modify/etc/rsyslog.conf:
Authpriv.warning/var/log/warning
Restart Service:
/etc/init.d/rsyslog restart
2. Execute an Order:
Sshd:172.16.20.211:spawn/bin/echo ' Date '%c%d >>/var/log/warning
#重定向追加到/var/log/warning file,%c is the logged-on user's information,%d is the service's process name
3, the output content to the terminal of the client:
Vsftpd:172.16.20.211:twist/bin/echo "refused to login from bloke."
4, before the connection display banner
Vsftpd:172.16.20.211:banners/var/banners/vsftpd
#此处文件名必须和服务名一致
Contents of the/var/banners/vsftpd file:
220- This is a test
220- This is B test
220- This is C test
All above can be found through man Hosts_deny and hosts_options.
TCP Wrapper < Memo >