Setting up SMB on Ubuntu is pretty easy

I switched my old Shuttle box from Windows Server 2003 to Ubuntu Linux 10.10. The server’s main purpose is to serve files, so SMB is a necessity.

Just as I did when I setup the RAID, I perfected the procedure on a VirtualBox virtual machine before attempting it on my shiny new Ubuntu install.

While connected to the Internet, get SMB by simply issuing this command:

sudo apt-get install samba smbfs

Edit smb.conf…

sudo cp /etc/samba/smb.conf /etc/samba/smb.master.conf
sudo nano /etc/samba/smb.master.conf

adding this…

[global]
workgroup = your_workgroup
security = user
[shared]
comment = Test shared samba folder
path = /smbshares/shared
writable = yes
create mask = 0660
directory mode = 0770
force group = smbusers
locking = yes
hide unreadable = yes

Apparently, the best way to produce a real smb.conf is with testparm. I ran it in my home directory:

testparm -s /etc/samba/smb.master.conf smb.conf

After reviewing the resulting smb.conf, I copied it to /etc/samba.

Also, I needed to add this to /etc/security/limits.conf

* - nofile 16384

In order to remove this warning:

rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)

I added myself as an SMB user:

sudo smbpasswd -a john

Also, I created an smbusers group and added myself to it

sudo addgroup smbusers
sudo usermod -a -G smbusers john

Since all files added through the SMB share will have the smbusers group and the permissions mask will permit full access to that group, I will simply add other users that group.

Make sure to chown the group owner of the shared folder to smbusers and chmod it 775.

Finally, I restarted the service…

sudo service smbd restart

.. and put a test file in my test shared folder. It works!

Not only does it work, but it’s really fast.

Nice!

This entry was posted in Linux and tagged , , . Bookmark the permalink. Follow any comments here with the RSS feed for this post. Both comments and trackbacks are currently closed.