This article was started to give some general advice on security considerations and is not an exhaustive review of samba security.


  • Networking Section - use "hosts allow" and "hosts deny"

# hosts allow =
hosts allow =
hosts deny =
  • hosts deny = all others.
  • Shares
    • When defining a share, consider the following options :
      1. browseable = no ~ Shares will not show up when browsing your network.
      2. users = user1 user2 ~ List of users able to access the share

When setting up a Samba share, you can limit the users who have access to your share

        comment = Private Share
        path = /path/to/share/point
        browseable = no
        read only = no
        valid users = user1 user2 user3

Now only samba users user1, user2, and user3 will have access to the share "private".


Configure your firewall (iptables) to limit access to your server. Samba uses ports

  • UDP ports 137 and 138
  • TCP ports 139 and 445

Samba/SecuringSamba (last edited 2010-12-27 18:16:49 by 190)