Jump to content
View in the app

A better way to browse. Learn more.

PHP论坛人

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Debian預設防火牆更改為iptables防火牆

Featured Replies

-------------------------------------------

Debian預設防火牆更改為iptables防火牆

-------------------------------------------

由於我慣用iptables防火牆,因此移除nftables防火牆

apt remove nftables

也移除ufw防火牆

apt remove ufw

安裝iptables防火牆

apt install iptables

看看iptables防火牆是否運作

iptables -L -v

------------------------------

設定防火牆規則

------------------------------

cd /usr/local/bin

vi firewall.sh

將iptables防火牆的規則,複製貼上到firewall.sh檔案裡

ESC儲存並離開

:wq

變更權限

chmod +x /usr/local/bin/firewall.sh

測試防火牆

./firewall.sh

./firewall.sh start

-------------------------

設置 rc.local 開機啟動

-------------------------

網路找到 rc.local 開機啟動

https://u.sb/debian-rc-local/

cat /lib/systemd/system/rc-local.service

systemctl status rc-local

將底下代碼寫入到rc.local

vi /etc/rc.local

#!/bin/sh -e

#

# rc.local

#

# This script is executed at the end of each multiuser runlevel.

# Make sure that the script will "exit 0" on success or any other

# value on error.

#

# In order to enable or disable this script just change the execution

# bits.

#

# By default this script does nothing.

exit 0

EOF

儲存並離開

:wq

執行 變更權限

chmod +x /etc/rc.local

啟動 rc-local 服務

systemctl enable --now rc-local

無視警告...

因為這個服務沒有任何依賴的系統服務,只是開機啟動 /etc/rc.local 腳本

將需要開機啟動的命令加到 /etc/rc.local 檔案中,放在 exit 0 前面即可,然後重開機

再次修改rc.local

vi /etc/rc.local

把這一行,放在 exit 0 前面即可

/usr/local/bin/firewall.sh start

儲存並離開

:wq

重開機

reboot

確認iptables防火牆的規則,有無成功執行,就是要看到你指定的IP有無出現

iptables -L

再次查看rc.local狀態

systemctl status rc-local.service

已經是 active (exited)

Create an account or sign in to comment

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.