I have an Ubuntu PC with ufw firewall (GUI version). I have added the preset Samba service, in and out, and even tried adding the ports manually (135-139, 445, UDP and TCP, in and out), but it still blocks samba.
I am trying to access a share on another PC on my LAN. If I disable ufw, it works fine. It must be still blocking something and I can't figure it out. Any ideas?
I'm on Ubuntu 11.04 beta 2.
Mike's
sudo ufw allow Samba
works like a charm.I personally prefer restricting to my private subnet, so for others who like the same, use:
Also, try running
sudo ufw app list
for a list of other apps you can use as short-hand to the required ports (eg. Postfix, OpenSSH, etc). Makes your firewall rules list a lot easier to read and maintain.To allow samba with ufw use the following command
See the links given to you by other users for additional information.
As I found no ufw profile for samba 4 I set up my own which worked for me (opens the ports as listed in the Samba Wiki: Ports for Samba 4 as PDC) and is easier to manage :
Create a new file: /etc/ufw/applications.d/samba4 with the following content
Now add it to ufw with one of the following commands:
sudo ufw allow from 192.168.192.0/24 to any app samba4
if you want to only allow it on your 192.168.1.0/24 networksudo ufw allow samba4
if you want to allow it for every networkIf you enter
sudo ufw status verbose
it will output something like the followingTry this:
As root, open
/etc/default/ufw
Look for the line like this:
Add
nf_conntrack_netbios_ns
to the line so that it looks like this:Now reload the firewall:
You can use logging to find out if you're blocking a port that should not be blocked.
Some extra information in case you havened tried it already: ufw manual , ufw wiki
I had the same problem.
Here's what I suggest: After installing Gufw, make sure you log out of your account and then log back in.
It worked for me.
In general, whenever you have a problem with software you just installed, try the above suggestion first.
You will be surprised as to how often it cures the problem.