Samba4 Basic Server
Note: The Samba4 Control Panel setup creates a ready-to-use share /root/SambaShare. It requires authentication by a client - with the "guest" user (for read-only) or with "root" (for read-write).
This is a guide for managing Samba4 Basic through its Control Panel. Here are some quick-start instructions:
1. Click the Config button. It loads the configuration file /etc/samba/smb.conf into your default text editor.
2. To change the server name as seen by clients, edit Line 7. See the image below.
3. To change the share name, edit Line 13.
4. To change the path to the folder you want to share, edit Line 14.
5. To add other shares, copy and paste Lines 13-15.
6. If you mess up your configuration file, there is a backup copy in /etc/samba.
After editing the smb.conf, restart the server from the Control Panel. Avoid making changes to the server while clients are connected. This can cause hangups that will require rebooting to clear. If Samba starts to behave strangely, shut down any client machines and restart the Samba server.
------------------------
From a Linux client, you can access the server with YASSM. Be aware that running a firewall on the client or server may cause problems.
On a Windows client, create a shortcut on the desktop and make the location
\\SambaServer. Note that this name starts with two back-slashes.
---------------------------
In the default configuration, all the shares you create are public. But you might want to give each user their own private folder on the server. For example:
1a. Create the Linux user "fred" with System Tools > Add new user.
1b. Open the "/home" folder. Change the properties of the "fred" folder so the owner has sole access.
1c. Assign a Samba password to "fred" with "smbpasswd -a fred".
2. Add a share entry to smb.conf:
Code: Select all
[fred]
path = /home/fred
writable = yes
valid users = fred
3. Restart the Samba server. Go to a client machine and create a new YASSM share where you login as fred.
4. If you plan to have multiple users, replace Step 2 with the single entry:
In the YASSM shares, leave the Share field blank. It will be automatically assigned to the user.
------------------------------
You may want a setup with a read-only public folder.
Code: Select all
[music]
path = /mnt/sdXY/music
read only = yes
public = yes
--------------------------------
You can also assign an external drive as a share. The drive must be mounted BEFORE starting the Samba server.
Code: Select all
[USB-Drive]
path = /mnt/sdb1
writable = yes
# To make the share writable, NTFS and FAT drives need the next line
force user = root
---------------------------
To complete your Samba server, you may want a common upload area where users can share their files.
1. Create the shared folder and give it a full set of permissions.
Code: Select all
mkdir /mnt/sdXY/upload
chmod 1777 /mnt/sdXY/upload
2. Add an smb.conf entry
Code: Select all
[upload]
path = /mnt/sdXY/upload
writable = yes
public = yes
All users have permission to write to the share. They can read each other's files but cannot delete them.
----------------------------------
To auto-start the Samba server at bootup, use the control panel. It has a script in /root/Startup that waits until your network is active, then runs samba-start. You can also use the script to mount any drives that you want to share.
-------------------------
A Samba server can share its attached printer(s) with clients on the network. But it's probably simpler to run a separate P910nd print server instead.
-------------------------------