alpine 常用操作

1.安装默认文件
2.安全配置,SSH
参考
https://wiki.alpinelinux.org/wiki/Fail2ban

Install

This will install fail2ban package. It includes iptables package (see also Configure_Networking#Firewalling_with_iptables_and_ip6tables)

apk add fail2ban

Enable the fail2ban service so that it starts at boot:
这里可以在重启后再执行,以防止 fail2ban 启动后就把自己的IP禁止了~~

rc-update add fail2ban

Start the fail2ban service immediately and create configuration files:

rc-service fail2ban start

List services to verify fail2ban is enabled:

rc-status

Configuration

  • Configuration files are located at /etc/fail2ba

查询登录失败的信息

grep 'Failed password' /var/log/messages

查看被禁止登录的IP

fail2ban-client status sshd