mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-23 02:35:38 +01:00
feat(ufw): add function for full reset ufw and allow ssh only
This commit is contained in:
parent
1ed17ac052
commit
47d3a38f5f
2 changed files with 10 additions and 0 deletions
|
|
@ -16,3 +16,4 @@ Some of the commands include:
|
|||
* `deny <port>/<optional: protocol>` add deny rule
|
||||
* `disable` disables the firewall
|
||||
* `enable` enables the firewall
|
||||
* `ufw-lockdown` full reset firewall and allow SSH only
|
||||
|
|
|
|||
9
plugins/ufw/ufw.plugin.zsh
Normal file
9
plugins/ufw/ufw.plugin.zsh
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# Function: Full reset and allow SSH only
|
||||
ufw-lockdown() {
|
||||
echo "Locking down firewall (allow only SSH)..."
|
||||
sudo ufw reset
|
||||
sudo ufw default deny incoming
|
||||
sudo ufw default allow outgoing
|
||||
sudo ufw allow ssh
|
||||
sudo ufw enable
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue