Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to setup UFW on a 12.04 server.

SSH works great with UFW off.

Setting

root@ugvps:~# ufw enable 
Firewall is active and enabled on system startup
root@ugvps:~# ufw status
Status: active

To                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere

The server now refuses all connections to 22 and the following appears in the log

Jul  8 15:12:49 ugvps kernel: [445929.928075] [UFW BLOCK] IN=venet0 OUT= MAC= SRC=217.86.198.115 DST=MY.SERV.ERI.Pxx LEN=48 TOS=0x00 PREC=0x00 TTL=118 ID=14040 DF PROTO=TCP SPT=48965 DPT=22 WINDOW=8192 RES=0x00 SYN URGP=0

What have I done wrong? Thanks

Edit: This is running inside an OpenVZ container if that matters. I've followed this guide to get ufw running in the first place

share|improve this question
1  
Are you sure the ssh is running and configure for that port? –  Bruno Pereira Jul 8 '13 at 11:58
    
What does runnining nmap on the IP address say? –  Anders Jul 8 '13 at 18:56
    
@ Bruno Pereira: Yes, because running ufw disable makes SSH immediately work again. –  user2025983 Jul 9 '13 at 7:44
    
@Anders see this paste with results. pastebin.com/7xdrRcxs Essentially, once I run ufw enable, everything is blocked. Otherwise, 22 and 80 are open –  user2025983 Jul 9 '13 at 7:49
    
You might want to look at this with 'iptable' command to see what rules is built by ufw actually does when you start. –  Anders Sep 3 '13 at 20:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.