Wednesday, 20 April 2011

how to configuration SAMBA Server

SAMBA SERVER
Type:             stand alone service
daemon:
Port:
package:          samba, samba-client, samba-common
demons:           /usr/sbin/nmbd, /usr/sbin/smbd
startup script:   /etc/init.d/smb
conf file:        /etc/samba/smb.conf


Installing samba server
1.install the samba package                     #yum install samba -y
2.configure global settings                     #vim etc/samba/smb.conf
3.check content of smb.conf                      #tdbdump /etc/samba/smb.conf
4.Hangup the smb service in service tray        #chkconfig smb on
5.start smb service                             #service smb start
6.Adding user in samba database                 #smbpasswd -a user_name

Access samba server
7.view samba shares                             #smbclient -L //192.168.8.254 -U john
                                                or
                                          #testparm

8.access samba shares   #smbclient//192.168.8.254/home/john -U john

Create a share folder using samba service
9  create a folder                        #mkdir /data
10 Configure samba                        #vim /etc/samba/smb.conf
                                                  [Global Settings]
                                                  workgroup = ROUND-9
                                                  server string = Samba Server Version %v
                                                 netbios name =MYSERVER
                                                 
                                                  [data]
                                                  comment = Public folder for ROUND-9
                                                  path = /data
                                                  public = yes
                                                  Browseable = yes
                                                  ;writable = yes
                                                  ;printable = no
                                                  ;write list = +staff

Restricting samba service from undesired network
11 Globally allow/deny                          #vim
     will effect on all share
12 sharewise allow/deny                         #vim /etc/samba/smb.conf
     will effect only for that share              allow hosts = 192.168.8. 192.168.8.2 .example.com station2.example.com
                                                  or
                                                  deny hosts = 192.168.8. 192.168.8.2 .example.com station2.example.com

Exercise samba share with permission

Example-1: allow read permission for valid user only                          [data]
                                                                               comment = Public folder for ROUND-9
                                                                               path = /data
                                                                               Browseable = yes
                                                                               valid users = susan, tawheed
Example-2: allow read permission for all samba user not for guest user        [data]
                                                                               comment = Public folder for ROUND-9
                                                                               path = /data
                                                                               Browseable = yes
Example-3: allow read permission for all samba user and with guest user       [data]
                                                                               comment = Public folder for ROUND-9
                                                                               path = /data
                                                                               public = yes
                                                                               Browseable = yes
Example-4: allow write permission for particular user                         [data]
                                                                               comment = Public folder for ROUND-9
                                                                               path = /data
                                                                               Browseable = yes
                                                                               writable = yes
                                                                               valid users = susan, tahmeed
Example-5: allow write permission to specific user other read                 [data]
                                                                               comment = Public folder for ROUND-9
                                                                               path = /data
                                                                               Browseable = yes
                                                                               writelist = tawheed
Example-6: allow write permission to specific user but other+guest read       [data]
                                                                               

No comments:

Post a Comment