alpine: add ssh iptable rules

This commit is contained in:
2025-11-01 20:15:38 +01:00
parent c4ce343e69
commit 49fd25152d
2 changed files with 2 additions and 6 deletions

View File

@@ -67,12 +67,6 @@ IP6TablesInstall() {
SSHEnableRootLogin() {
sed -i "/PermitRootLogin prohibit-password/c\PermitRootLogin yes #prohibit-password" /etc/ssh/sshd_config
service sshd restart
if [ -f "/etc/iptables/rules-save" ]; then
sed -i '/^-A INPUT -i lo -j ACCEPT.*/a -A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -j ACCEPT' /etc/iptables/rules-save
sed -i '/^-A INPUT -i lo -j ACCEPT.*/a # SSH' /etc/iptables/rules-save
iptables-restore /etc/iptables/rules-save
fi
}
SNMPDInstall() {
cummunityname=public