Ubuntu 10.04 Samba Standalone Server With tdbsam Backend
1 Preliminary Note
I'm using an Ubuntu 10.04 system here with the hostname server1.example.com and the IP address 192.168.0.100.
I'm running all the steps in this tutorial with root privileges, so make sure you're logged in as root:
sudo su
2 Installing Samba
Connect to your server on the shell and install the Samba packages:
aptitude install libcups2 samba samba-common
Edit the smb.conf file:
vi /etc/samba/smb.conf
In the global section, remove the "#" at the beginning of the line security = user so that it looks like this:
This enables Linux system users to log in to the Samba server.
Close the file and restart Samba:
/etc/init.d/smbd restart
3 Adding Samba Shares
Now I will add a share that is accessible by all users.
Create the directory for sharing the files and change the group to the users group:
mkdir -p /home/shares/allusers
chown -R root:users /home/shares/allusers/ chmod -R ug+rwx,o+rx-w /home/shares/allusers/
At the end of the file /etc/samba/smb.conf add the following lines:
vi /etc/samba/smb.conf
If you want all users to be able to read and write to their home directories via Samba, add the following lines to /etc/samba/smb.conf:
Now we restart Samba:
/etc/init.d/smbd restart
4 Adding And Managing Users
In this example, I will add a user named tom. You can add as many users as you need in the same way, just replace the username tom with the desired username in the commands.
useradd tom -m -G users
Set a password for tom in the Linux system user database. If the user tom should not be able to log in to the Linux system, skip this step.
passwd tom
-> Enter the password for the new user.
Now add the user to the Samba user database:
smbpasswd -a tom
-> Enter the password for the new user.
Now you should be able to log in from your Windows workstation with the file explorer (address is \\192.168.0.100 or \\192.168.0.100\tom for tom's home directory) using the username tom and the chosen password and store files on the Linux server either in tom's home directory or in the public shared directory.
ค่า config
[global] security = USER ## Browsing/Identification ### # Change this to the workgroup/NT-domain name your Samba server will part of workgroup = WORKGROUP netbios name = datacenter # server string is the equivalent of the NT Description field server string = %h server (Samba, Ubuntu) admin
users = jason
# usershare allow guests = yes
[allusers]
comment = All Users
path = /home/shares/allusers
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
writable = yes
[homes]
comment = Home Directories
browseable = no
valid users = %S
writable = yes
create mask = 0700
directory mask = 0700
|