Enable Access to Samba Shares on your Ubuntu Box with ufw

Written by James McDonald

December 31, 2009

If your Linux box is a Samba Server and you wish to enable access to it from other computers on your LAN.

Use these ufw commands to work the magic.

sudo ufw allow proto tcp from 10.11.12.0/24 to 10.11.12.19 port 445
sudo ufw allow proto udp from 10.11.12.0/24 to 10.11.12.19 port 137
sudo ufw allow proto udp from 10.11.12.0/24 to 10.11.12.19 port 138
sudo ufw allow proto tcp from 10.11.12.0/24 to 10.11.12.19 port 139

# Where 10.11.12.0/24 is your LAN's subnet address 
# and 10.11.12.19 is your Linux Samba box's IP Address.

# when you run ufw status you should get:
sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
10.11.12.19 445/tcp      ALLOW       10.11.12.0/24
10.11.12.19 137/udp      ALLOW       10.11.12.0/24
10.11.12.19 138/udp      ALLOW       10.11.12.0/24
10.11.12.19 139/tcp      ALLOW       10.11.12.0/24

Port Information from here

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Squarespace Image Export

To gain continued access to your Squarespace website images after cancelling your subscription you have several...

MySQL 8.x GRANT ALL STATEMENT

-- CREATE CREATE USER 'tgnrestoreuser'@'localhost' IDENTIFIED BY 'AppleSauceLoveBird2024'; GRANT ALL PRIVILEGES ON...

Exetel Opt-Out of CGNAT

If your port forwards and inbound and/or outbound site-to-site VPN's have failed when switching to Exetel due to their...