ubuntu server firewall help
I am new to ubuntu server and linux and I want to setup a firewall, I tried to setup ufw and it locked me out from remote login.
I am new to linux. I sudo ufw allow 80,443, my ssh xxxx port. I also sudo ufw allow proto tcp from (my ip address) and I locked myself out. What did I do wrong? |
Honestly, the absolute best thing you can do is to use IPTables directly instead of UFW, Firestarter, or another front end. The syntax, though slightly cryptic at first, is rather simple. Here is a link to an introductory iptables tutorial, though there are plenty more to choose from.
In your case, I would recommend setting the default policy to accept, so that when the firewall rules get cleared, it defaults to allowing you access. Remember that, unlike Windows, Linux does not keep ports open by default, meaning a firewall is a secondary layer of security rather than a must have to prevent intrusion. Iptables rules are pretty straightforward. For example, in your case something like the following would work: Code:
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT |
A good starting tutorial about iptables rules:
http://slackbook.org/html/security-host.html But it's about pure iptables, not ufw. I recommend you using iptables. |
locked myself out again
Quote:
??? |
The above commands should not have locked you out by themselves, unless your not listening for SSH on the port you think you are. Use netstat to double check what port(s) ssh is listening on.
Then, there are three things I would suggest.
|
Quote:
Strange... |
Quote:
|
Quote:
Normally, the restore script is called as part of the process of bringing up the network interface and some distributions, such as RH and Centos, incorporate the firewall into the system control. |
Quote:
|
Quote:
|
All times are GMT -5. The time now is 11:00 PM. |