Welcome to the tutorial guide. The guide will provide you with guidance and instructions on how to install server.
Installing Samba server
If you would like to install Samba Server for files/folders sharing service, then please go to:
- Desktop
- System Settings
- Add/Remove Applications
or
you can run command as following:
su -c ‘yum -y install samba’
su -c ‘yum -y install samba-client’
su -c ‘yum -y install system-config-samba’
- in order to enable file sharing on boot, please run following command:
su -c ‘chkconfig smb on’
- then go to:
- Desktop
- System Settings
- Server Settings
- Samba
If you would like to add/edit/delete network users then please go to:
- Desktop
- System Settings
- Server Settings
- Samba
or
In order add network user, please run following command:
su -c ’smbpasswd -a system_username’
su -c ‘gedit /etc/samba/smbusers’
- please insert the following line into the new file
system_username = “network username”
- now, please save the edited file
-in order to edit network user, please run following command:
su -c ’smbpasswd -a system_username’
- in order to delete network user, please run following command:
su -c ’smbpasswd -x system_username’
If you would like to share home folders with read/write permissions, then please run following command:
su -c ‘cp /etc/samba/smb.conf /etc/samba/smb.conf_backup’
su -c ‘gedit /etc/samba/smb.conf’
- the next step is to find this line
…
; security = user
…
- after finding the line, now please replace it with the following lines
security = user
username map = /etc/samba/smbusers
- finally, save the edited file
testparm
- now, please restart by running following command:
su -c ‘/etc/init.d/smb restart’
If you would like share home folders with read only permission, then please run following command:
su -c ‘cp /etc/samba/smb.conf /etc/samba/smb.conf_backup’
su -c ‘gedit /etc/samba/smb.conf’
- now, please find this line
…
; security = user
…
- after finding the line, now replace it with the following lines
security = user
username map = /etc/samba/smbusers
- now, please find this line
[homes]
comment = Home Directories
browseable = no
writeable = yes
- after finding the line, now please replace it with the following lines
[homes]
comment = Home Directories
browseable = yes
writeable = no
- finally, save the edited file
testparm
su -c ‘/etc/init.d/smb restart’
If you would like to share group folders with read only permission, then please run following command:
su -c ‘mkdir /home/group’
su -c ‘chmod 777 /home/group/’
su -c ‘cp /etc/samba/smb.conf /etc/samba/smb.conf_backup’
su -c ‘gedit /etc/samba/smb.conf’
- now, please find this line
…
; security = user
…
- after finding the line, please replace it with the following lines
security = user
username map = /etc/samba/smbusers
- append the following lines at the end of file
[Group]
comment = Group Folder
path = /home/group
public = yes
writable = no
valid users = system_username1 system_username2
create mask = 0700
directory mask = 0700
force user = nobody
force group = nogroup
- finally save the edited file
testparm
- please restart by running following command:
su -c ‘/etc/init.d/smb restart’
If you would like to share group folders with read and write permissions then please follow the steps as mentioned below:
- please run following command:
su -c ‘mkdir /home/group’
su -c ‘chmod 777 /home/group/’
su -c ‘cp /etc/samba/smb.conf /etc/samba/smb.conf_backup’
su -c ‘gedit /etc/samba/smb.conf’
- now, please find this line
…
; security = user
…
- replace it with the following lines
security = user
username map = /etc/samba/smbusers
- please append the following lines at the end of file
[Group]
comment = Group Folder
path = /home/group
public = yes
writable = yes
valid users = system_username1 system_username2
create mask = 0700
directory mask = 0700
force user = nobody
force group = nogroup
-finally, save the edited file
testparm
- do a restart by running following command:
su -c ‘/etc/init.d/smb restart’
If you would like to share public folders with read only permission, then please run following command:
su -c ‘mkdir /home/public’
su -c ‘chmod 777 /home/public/’
su -c ‘cp /etc/samba/smb.conf /etc/samba/smb.conf_backup’
su -c ‘gedit /etc/samba/smb.conf’
- please find this line
…
; security = user
…
-replace it with the following lines
security = user
username map = /etc/samba/smbusers
- please append the following lines at the end of file
[public]
comment = Public Folder
path = /home/public
public = yes
writable = no
create mask = 0777
directory mask = 0777
force user = nobody
force group = nogroup
- now, save the edited file
testparm
-finally, do a restart by running following command:
su -c ‘/etc/init.d/smb restart’
If you would like to share public folders with read and write permissions, then please run following command:
su -c ‘mkdir /home/public’
su -c ‘chmod 777 /home/public/’
su -c ‘cp /etc/samba/smb.conf /etc/samba/smb.conf_backup’
su -c ‘gedit /etc/samba/smb.conf’
- please find this line
…
; security = user
…
- now, please replace it with the following lines
security = user
username map = /etc/samba/smbusers
- please append the following lines at the end of file
[public]
comment = Public Folder
path = /home/public
public = yes
writable = yes
create mask = 0777
directory mask = 0777
force user = nobody
force group = nogroup
- please do not forget to save the edited file
testparm
- finally, do a restart by runnning following command:
su -c ‘/etc/init.d/smb restart’
If you would like share public folders with read only permission, then please run following command:
su -c ‘mkdir /home/public’
su -c ‘chmod 777 /home/public/’
su -c ‘cp /etc/samba/smb.conf /etc/samba/smb.conf_backup’
su -c ‘gedit /etc/samba/smb.conf’
- now, please find this line
…
; security = user
…
- please replace it with the following line
security = share
- now, append the following lines at the end of file
[public]
comment = Public Folder
path = /home/public
public = yes
writable = no
create mask = 0777
directory mask = 0777
force user = nobody
force group = nogroup
- please save the edited file
testparm
- finally, please restart by running following command:
su -c ‘/etc/init.d/smb restart’
If you would like to share public folders with read and write permissions then please run following command:
su -c ‘mkdir /home/public’
su -c ‘chmod 777 /home/public/’
su -c ‘cp /etc/samba/smb.conf /etc/samba/smb.conf_backup’
su -c ‘gedit /etc/samba/smb.conf’
- please find this line
…
; security = user
…
- after finding the line, please replace it with the following line
security = share
- now, append the following lines at the end of file
[public]
comment = Public Folder
path = /home/public
public = yes
writable = yes
create mask = 0777
directory mask = 0777
force user = nobody
force group = nogroup
- please save the edited file
testparm
- finally, please restart by running following command:
su -c ‘/etc/init.d/smb restart’
If you would like to map URLs to folders outside /var/www/, then pleas run following command:
su -c ‘gedit /etc/httpd/conf.d/alias’
- now, please insert the following lines into the new file
Alias /URL-path /location_of_folder/
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
- please save the edited file
- finally, run following command to restart:
su -c ‘/etc/init.d/httpd restart’
If you followed advise and guidance as provided in this tutorial guide, then you would have successfully installed the servers.