more_ufw_commands_and_examples
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
more_ufw_commands_and_examples [2016/07/24 20:20] – walkeradmin | more_ufw_commands_and_examples [2023/03/09 22:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== More UFW Commands and Examples ====== | ====== More UFW Commands and Examples ====== | ||
+ | \\ | ||
+ | \\ | ||
+ | Most of this information was acquired from // | ||
\\ | \\ | ||
\\ | \\ | ||
Line 10: | Line 13: | ||
\\ | \\ | ||
NOTE: I added sudo to the command because you must have admin privileges to run ufw. If you’re using a distribution that doesn’t take advantage of sudo, you’d first have to su to root and then run the same command (minus sudo). | NOTE: I added sudo to the command because you must have admin privileges to run ufw. If you’re using a distribution that doesn’t take advantage of sudo, you’d first have to su to root and then run the same command (minus sudo). | ||
+ | \\ | ||
Conversely, say you want to prevent traffic on port 22. To do this, the command would look like: | Conversely, say you want to prevent traffic on port 22. To do this, the command would look like: | ||
- | sudo ufw deny 22 | + | \\ |
+ | | ||
+ | \\ | ||
Should you want to add a protocol to this, the command would look like: | Should you want to add a protocol to this, the command would look like: | ||
- | sudo ufw deny 22/tcp | + | \\ |
+ | | ||
+ | \\ | ||
What happens if you don’t happen to know the port number for a service? The developers have taken that into consideration. UFW will run against / | What happens if you don’t happen to know the port number for a service? The developers have taken that into consideration. UFW will run against / | ||
- | sudo ufw allow ssh | + | \\ |
+ | | ||
+ | \\ | ||
Pretty simple, right? You can also add protocols to the above command, in the same way you did when defining a rule via port number. | Pretty simple, right? You can also add protocols to the above command, in the same way you did when defining a rule via port number. | ||
- | sudo ufw allow ssh/tcp | + | \\ |
+ | | ||
+ | \\ | ||
+ | \\ | ||
more_ufw_commands_and_examples.txt · Last modified: 2023/03/09 22:35 by 127.0.0.1