Thursday, 13 February 2014

How to configure Samba Server in RHEL 6 Linux Os.

So in this documentation we are going to share a folder named /data over network using samba server .The best thing about samba server is we can access samba shares in any Windows OS like Windows XP,Vista,Windows 7 etc.
  • Samba Server also supports User based Authentication and Host Based Restrictions .
  • Samba Server is also restricted by Selinux enforcing mode.So guys keep in mind to change the Selinux Context of File or Directories.

Steps to configure Samba Server :-

  • yum -y install samba* (command to install samba server packages )

  • Now create /data directory if not already created in your system.
            mkdir /data

  • Now as Selinux is in enforcing mode so please change the context of /data directory.Guys its not recommended to disable or make selinux permissive .So work in enforcing mode and change the context as follows.
           chcon -R -t  samba_share_t   /data

  •  Now edit /etc/samba/smb.conf
       In this file we need to move to global settings section and we need to define workgroup of our network as below.
              workgroup = MYGROUP  (MYGROUP is the name of workgroup we want to define )

Now we need to define interfaces of server machine which are allow to receive client queries. For example on server pc if we have two interfaces named eth0 and eth1 but we want to have samba share request only on eth0 so we can do that using interfaces option in smb.conf file as below.
          
                         interfaces = lo eth0

Now we need to define share folder we need to share across network.

{myshare}    >>> this is the share name of folder.
comment = my share folder   >>> any description
path = /data
writable = yes  >> writable option is use to give write permission if writable is yes than user will have read and write permission otherwise user will have read permissions only.
valid users = user1 >>> user1 is allow to access this share folder accross network.

browseable = yes >>> this option will make this folder visible when user list all share folders.

Now save and quit this file.

Now as we have define user1 for samba share so we need to create this user and also need to define samba password for this user.

useradd user1
smbpasswd -a user1 >> command to define samba password.

-a option is use to to add user in the samba user's catalog.


Now finally start samba daemons to apply changes :

service smb restart
chkconfig smb on


Wednesday, 12 February 2014

How to define File Access Control List (FACL or ACL) in Linux RHEL6

In linux we know to define permissions we have chmod command but this command defines permission to user mode group mode or others only .But if we need to define different permissions to different users individually we need to think about setfacl and getfacl commands .

The setfacl command is use to define file or folder permissions for individual user or group other than user owner group owner or other (i.e ugo).

setfacl -m u:username:permission <file absolute or relative path>

-m -- option to modify permission
u -- for user
g -- for group

The getfacl command is use to check ACL implemented on a file or folder.

How to Configure RedHat Directory Server in RHEL6

Coming Soon.....