SAMBA Server COnfiguration.
1. Install SAMBA using the yum utility.
#yum install samba samba-client samba-common
2. Samba Configuration file is "/etc/samba/smb.conf".
3. Create samba user
useradd smb1
smbpasswd -a smb1 -> Make that as samba user.
4. Append following directives once taking the backup. Each configurations is explained.
[smbdemo]
>>
The section name is the name of the shared resource and the parameters within the section define the shares attributes. By default, in the samba configuration file, there are three special sections, [global], [homes] and [printers],
comment = Samba config local variable
path = /mysamba
>>
Sets the path to the directory provided by a file share or used by a printer share. Set automatically in [homes] share to user's home directory, otherwise defaults to /tmp.
security = user
>>
Sets password-security policy. If security = share, services have a shared password, available to everyone. If security = user, users have (Unix) accounts and passwords. If security = server, users have accounts and passwords and a separate machine authenticates them for Samba. If security = domain, full NT-domain authentication is done. See also the password server and encrypted passwords configuration options.
browseable = yes
>>
Allows share to be displayed in list of machine resources.
guest ok = yes
>>
If YES, passwords are not needed for this share. Synonym of public.
read only = no
>>
Sets a share to read-only. Antonym of writable and write ok.
cretate mask =0755
>>
Also called create mode. Sets the maximum allowable permissions for new files (e.g., 0755). See also directory mask. To require certain permissions to be set, see force create mask/force directory mask. This option stopped affecting directories in Samba 1.9.17, and the default value changed in Samba 2.0.
writable = yes
>>
Antonym for read only; synonym of write ok.
valid users = smb1
>>
Allowable values: list of users. List of users that can log in to a share.
host allow = 192.168.56.1
>>
Synonym for hosts allow. List of machines that may connect to a share.
If you come across error as "You do not have permission to view the domaion". Follow the below steps to get this fixed.
6. For servers with selinux enabled, do the folliwng.
----
Get list of selinux variables. Use the command:
#getsebool -a
To set boolean parameter of selinux, use a command called setsebool. For smb to work, you need set boolean parameter using the command:
setsebool -P samba_enable_home_dirs=on
# Check firewal and open open ports (445,137,138,139)
7. Now, use the 'chcon' command to change the file type, to
chcon -R -t samba_share_t /mysamba
Note:- samba_share_t is file system type and 'R' represent the recursive feature.
8. testparm - to check configuration file of samba. "/etc/samba/smb.conf"
9. Verify the connection via "Network option" in Windows
Help URL:
http://www.oreilly.com/openbook/samba/book/appc_01.html
https://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html
https://www.samba.org/samba/docs/using_samba/ch07.html
1. Install SAMBA using the yum utility.
#yum install samba samba-client samba-common
2. Samba Configuration file is "/etc/samba/smb.conf".
3. Create samba user
useradd smb1
smbpasswd -a smb1 -> Make that as samba user.
4. Append following directives once taking the backup. Each configurations is explained.
[smbdemo]
>>
The section name is the name of the shared resource and the parameters within the section define the shares attributes. By default, in the samba configuration file, there are three special sections, [global], [homes] and [printers],
comment = Samba config local variable
path = /mysamba
>>
Sets the path to the directory provided by a file share or used by a printer share. Set automatically in [homes] share to user's home directory, otherwise defaults to /tmp.
security = user
>>
Sets password-security policy. If security = share, services have a shared password, available to everyone. If security = user, users have (Unix) accounts and passwords. If security = server, users have accounts and passwords and a separate machine authenticates them for Samba. If security = domain, full NT-domain authentication is done. See also the password server and encrypted passwords configuration options.
browseable = yes
>>
Allows share to be displayed in list of machine resources.
guest ok = yes
>>
If YES, passwords are not needed for this share. Synonym of public.
read only = no
>>
Sets a share to read-only. Antonym of writable and write ok.
cretate mask =0755
>>
Also called create mode. Sets the maximum allowable permissions for new files (e.g., 0755). See also directory mask. To require certain permissions to be set, see force create mask/force directory mask. This option stopped affecting directories in Samba 1.9.17, and the default value changed in Samba 2.0.
writable = yes
>>
Antonym for read only; synonym of write ok.
valid users = smb1
>>
Allowable values: list of users. List of users that can log in to a share.
host allow = 192.168.56.1
>>
Synonym for hosts allow. List of machines that may connect to a share.
If you come across error as "You do not have permission to view the domaion". Follow the below steps to get this fixed.
6. For servers with selinux enabled, do the folliwng.
----
Get list of selinux variables. Use the command:
#getsebool -a
To set boolean parameter of selinux, use a command called setsebool. For smb to work, you need set boolean parameter using the command:
setsebool -P samba_enable_home_dirs=on
# Check firewal and open open ports (445,137,138,139)
7. Now, use the 'chcon' command to change the file type, to
chcon -R -t samba_share_t /mysamba
Note:- samba_share_t is file system type and 'R' represent the recursive feature.
8. testparm - to check configuration file of samba. "/etc/samba/smb.conf"
9. Verify the connection via "Network option" in Windows
Help URL:
http://www.oreilly.com/openbook/samba/book/appc_01.html
https://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html
https://www.samba.org/samba/docs/using_samba/ch07.html