Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to setup UFW on a 12.04 server.

SSH works great with UFW off.


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= 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
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. 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

Your Answer


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

Browse other questions tagged or ask your own question.