Professional Documents
Culture Documents
Samba
Install and configure samba
Configure the mirror
• Directory
/etc/apt/sources.list
Samba
Samba Server Types and the smb.conf
File
Samba server can be configured in different ways
• Anonymous access
• Samba file with user access with the homes section
• Samba file with user access and share (force group and force
user )
• /etc/samba/smb.conf
5
Samba
Type 1
configuring samba to allow
anonymous access to the share
Configure the smb.conf files
• Sudo vi /etc/samba/smb.conf
[global] [name for the share]
workgroup = WORKGROUP comment = Networking Department
security = share files path = Path of the shared file
map to guest = Bad User
(eg. path = /home/abel/lectureNotes)
show add printer wizard = No
wins support = yes read only = No
guest ok = Yes
Samba
To check the samba config file is correct or not type
• testparm –s
Check first your server and the client must be on the same network
by pinging the server from the client machine using sever name or IP
address
ping servername or Ping IP address
Samba
To access the shared file from windows
client
start → run
then type the servername (ip address) of the server and share name
Samba
Type 2
Samba file with user access with the
homes section
Assume
Server name : cci
Group name: ITDept
Creation of user
Useradd -m –G groupName UserName
-m is creating a user home directory (/home/userName)
-G put UserName in the users group
Example
Useradd -m –G ITDept Alex
-m is creating a user home directory (/home/Alex)
-G put Alex in the users group (in this case the group is ITDept) 9
Samba
Creating password
Create password for the user Alex
Passwd Alex
and retype the passwd
Create a samba password for user Alex
smbpasswd –a Alex
and retype the password
The user will be added to samba user list
10
Samba
Samba config file
Create password for the user Alex
sudo Vi /etc/samba/smb.conf
11
Samba
Type 3
Samba file with user access and share
(force group and force user )
Assume our
To Create users group to be used for the
share Server name : cci
groupadd GC Group name: GC
To add user chala in group users Users: chala , sami,
Useradd -m –G GC chala dawit
Create password for the user chala Share: Project
passwd chala Guideline
and retype the passwd
Create a samba password for user chala
smbpasswd –a chala
and retype the password
- The user chala will be added to samba user list
12
Samba
Cont’d
To add more users in the created group
adduser NameOfUser NameOfGroup
Example
adduser sami GC
Samba
Configure the smb.conf
sudo vi /etc/samba/smb.conf
[global]
[Project Guideline]
workgroup = WORKGROUP comment = Guideline for final year project
security = user path = /home/user/Desktop/Guidlines
read only = No
[homes] valid users = @GC
Comment = Home Directories force user = chala, sami
valid users = @GC read only force group = GC
= No
browseable = No
14
Samba
Example: Map network drive for user
chala
→
1. Open my computer → click tools from the menu bar Map Network Drive...
2. From the dropped down menu select Drive Letter eg G, H, Z
3. In the box labeled “Folder”, type
\\servername(cci) \share name(project Guideline)
4. Click finish
5. Then you will get the username and password dialog box
6. Type user name and password for the user chala
Then you will get the network drive of Chala and you can put your file in the
chala’s network drive.
So that the system administrator can set access control and user and group
permissions according to the role of the user in /etc/samba/smb.conf share setup.
Samba 15