Samba

SAMBA CONFIGURATION

Samba is the Linux utility which help to share files among Linux and windows system.

Service profile: SYSTEM V MANAGED SERVICE

RPM’s required: samba, samba-client, samba-common

1. mkdir /data //Share directory

2. groupadd dcl

3. ls –ld //to se the files ownership and permission

4. chgrp dcl /data

5. ls –ld //to se the files ownership and permission

6 useradd –s /sbin/nologin –d /data sandy //This will create a samba user with nologin shell and /data as home directory

7. smbpasswd -a sandy // this will add the user as samba user

8. usermod –G dcl sandy //This will add sandy to dcl group

9. getent group dcl

10. chmod g+rwx /data

11. chmod o-rwx /data

12. ls -ld /data

13. chown sandy /data //This will change the ownership of the data directory to sandy

14. Now edit the /etc/samba/smb.conf

[global]

workgroup = sandip

server string = SANDIP’S SHAMBA SHARING

host. Allow = 10.200. 10.201.

//no set the share name, directory, the user, and permission for samba

[data] //share name for windows user

comment = Sandip’s Stuff

path = /data

valid users = sandy

writeable = yes

printable = no

create mask = 0765

browseable = yes

Now save the file and start samba services

15. service smb start

16. service smb restart

Automating Mounting With Linux SAMBA Clients

we can also automate the mounting of shares by placing entries in your /etc/fstab file. Here the home directory of user sandip on server 192.168.1.11 will be mounted on the /mnt/smb mount point as smbfs.The login information in the file named /etc/cred.

#

# File: /etc/fstab

#

//192.168.1.100/sandip /mnt/smb smbfs credentials=/etc/cred 0 0

The contents of the /etc/cred file needs to have the username and password for the account in this format:

#

# File: /etc/cred

#

username = sandip

password = sandippassword

Once finished you can use the mount -a to mount the new /etc/fstab entry, and the /mnt/smb directory will now contain the contents of the share.