Here is how to setup Samba and GNOME Nautilus to allow user directory sharing without having to allow root access. These commands are made with Debian in mind, so if you want to use them for your Linux distribution, you’ll have to adapt them.
- Install samba and nautilus-share.
- Rename your
smb.conf
tosmb.conf.master
- Add the following to
smb.conf.master
somewhere under the[global]
stanza using your favorite text editor. - Run the following command:
- Restart samba.
- Add your user to the
sambashare
group. If more people use the system and they need to share files, make sure to add them as well. - Log out of your user session, then log back in.
- On Nautilus, when you right-click directories you will now see a “Sharing options” item. Through this item you can:
- Share the folder, assigning a share name.
- Allow read/write access.
- Enable Guest access, which allows people without a user account on the system to access the share.
# aptitude install samba nautilus-share
# cd /etc/samba
# mv smb.conf smb.conf.master
security = SHARE
usershare allow guests = Yes
usershare owner only = No
# testparm -s smb.conf.master > smb.conf
This tests the samba master configuration file, then outputs the results to the file samba itself will use for its configuration. If it finds errors, it will warn you about them.
According to the Samba docs, a small smb.conf
file improves performance. It also improves readability once you’re familiar with Samba options.
# /etc/init.d/samba restart
# useradd -G sambashare foo
This last option is the most useful as people can now get stuff through the network without having to deal with usernames or passwords. Does this make the Linux system behave like a Windows system? Yes, it does.
There is something to be said, however, about the convenience of creating shares without having to muck around the smb.conf.master
file whenever you want to make a change.