Servers-for-Hackers / the-book

Servers for Hackers eBook Issues
63 stars 5 forks source link

Instructions p37 cause me to be locked out of my Vagrant Box #72

Closed Alienpruts closed 6 years ago

Alienpruts commented 7 years ago

First off, great book, definitively learnt a few tricks so far.

However, when reaching the chapter on UFW, whenever I try the following code on P37 : sudo iptables -F INPUT sudo iptables -F OUTPUT sudo iptables -F FORWARD

I cannot input any text any longer into the server. Furthermore, I cannot login via SSH any longer (using vagrant ssh as well as ssh [username]@[ipaddress]). Using the verbose option of SSH reveals little : it only mentions that connection could not be established.

No real harm done here, a simple vagrant up --provision does the trick, however, I cannot us the iptables -F command at that time, I always get locked out of my box.

EDIT : I've figured it out.

When following along, on P34 we changed the default action for INPUT table from ACCEPT to DROP. So, whenever the INPUT table gets flushed, all packets get dropped. Furthermore, the ESTABLISHED rule is also gone, so the flushed INPUT table has direct effect on the already established rules, effectively shutting me out of the box.

Hope this helps anyone reading this :)

fideloper commented 7 years ago

Sorry I haven't responded to all your feedback yet - I definitely will be getting all this into the book in the near future.

Appreciate you help - thanks!

fideloper commented 6 years ago

Updated the text a bit about that