CentOS Installation Samba Service

Source: Internet
Author: User

1. Online Samba Service installation
# yum Install Samba samba-client Samba-swat
2. Back up the Samba master configuration file, file directory/etc/samba/samba.conf
# CP smb.conf Smb.conf.backup
3. Modify the samba.conf configuration file
The changes are as follows: All other code not shown is turned off [global]netbios name = mditip_server \ \ Network display server name server string = Samba Server Version               %V \ \ Server Some description information security = SHARE \ security level log file =/var/log/samba/log.%m     \ \ log Information idmap config *: backend = tdbhosts allow = 127., 192.168.17., 192.168.1.                    \ \ Allow access to the IP segment [public]comment = Gene pictures \ \ To the description file of the shared directory, you can define the description information path =/work/mditip/pictures                                  \ \ shared path Read only = No \ \ \ is read guest OK = Yes \ \ Everyone can view, equivalent to public = yes Security level description: 1. Share: User access to Samba server does not require a user name and password, and security can be low.    2. The User:samba server shared directory can only be accessed by authorized users, and Samba server is responsible for checking the correctness of the account and password. The account number and password are to be established in this Samba server.    3. Server: Relying on other Windows nt/2000 or Samba server to verify the user's account and password, is a proxy authentication. In this safe mode, the system administrator can centralize all Windows users and passwords on an NT system, and use Windows NT for Samba authentication the remote server can automatically authenticate all users and passwords, and if authentication fails, Samba uses the user-level security mode as an alternative. 4. Domain: Zone security level, using the primary domain controller (PDC) to complete authentication.
4. Modify permissions for shared files/work/mditip/pictures
chmod 777-r/work/mditip/pictures
5. Restart the SMB service

Service SMB Restart
Service NMB Restart

6, if you meet the Windows client can not write the situation (prompt does not have permission) may be selinux open about

Solutions
Run: Setenforce [0|1]
Parameter description:

0: Turn into permissive tolerance mode; 1: Turn into enforcing mandatory mode
7, then you can access the SELinux description 1. SELinux startup, shutdown, and view
Not all Linux distributions support SELinux's current SELinux support for three modes, as follows: 1), enforcing: Mandatory mode, representing SELinux operation, and has correctly begun to limit the Domain/type; 2 ), Permissive: Tolerance mode: On behalf of SELinux operation, but only a warning message will not actually limit the access of domain/type.    This mode can be shipped as SELinux Debug, 3), disabled: Off, SELinux does not actually work.
2. View SELinux mode
# Getenforce Enforcing  <== shows that the current mode is enforcing
3. View SELinux Policy
# Sestatusselinux Status:                 enabled    <== whether to start Selinuxselinuxfs mount:                /selinux   <==selinux Relevant file data mount point current mode: Enforcing <== The present model of the mode from  config file:          enforcing  <== profile Specifies the schema policy Version:                 21Policy from config file:        targeted   <== What is the current policy?
4. Adjust SELinux parameters by configuration file
# vi/etc/selinux/configselinux=enforcing     <== adjustment enforcing|disabled|permissiveselinuxtype=targeted  <== currently only has targeted and strict
5. SELinux Startup and shutdown
"Important common sense" above is a pre-set policy with the starting mode!    It is important to note that if you change the policy you need to restart the boot, or if it is changed from enforcing or permissive to disabled, or changed from disabled to two, it must be rebooted.    This is because SELinux is integrated into the core, you can only be in the SELinux operation to switch to force (enforcing) or tolerant (permissive) mode, can not directly shut down SELinux! At the same time, the state of the SELinux shutdown (disable) to the open state also needs to be rebooted!  So, if you have just found Getenforce appear disabled, please go to the above file changes to become enforcing bar! "Focus" If you want to start selinux you must meet the following two points: So, if you want to start SELinux, please set the above selinux=enforcing, and specify selinuxtype=targeted this setting, and to/    Boot/grub/menu.lst This file go and see if the core has a shutdown SELinux?    [[email protected] ~]# vi/boot/grub/menu.lst default=0 timeout=5 splashimage= (hd0,0)/grub/splash.xpm.gz Hiddenmenu title CentOS (2.6.18-92.el5) root (hd0,0) kernel/vmlinuz-2.6.18-92.el5 ro root=label=/1 rhgb quiet SE    Linux=0 Initrd/initrd-2.6.18-92.el5.img # If you want to start SELinux, you may not be able to appear selinux=0 the words behind kernel!    "Problem" If you change the startup SELinux to Disabled, you need to restart the computer, we do not want to restart the computer and do not want to open selinux what to do?    Answer will change the forced mode to loose mode! [[email protected] ~]# setenforce [0|1] options and Parameters: 0: Turn into Permissive tolerance mode; 1: Turn to enforcing mandatory mode example one: Change SELinux between enforcing and permissive [[email protected] ~]# s Etenforce 0 [[email protected] ~]# getenforce Permissive [[email protected] ~]# setenforce 1 [[E Mail protected] ~]# Getenforce enforcing
6. View the startup program's type settings
[[Email protected] oracle]# PS aux-z    LABEL                           USER       PID%cpu%MEM    VSZ   RSS TTY      STAT START   time COMMAND    system_u:system_r:init_t        root         1  0.0  0.4   2060   520?        Ss   May07   0:02 init [5    system_u:system_r:kernel_t      root         2  0.0  0.0      0     0 ?        s<   May07   0:00 [Migra]    system_u:system_r:kernel_t      root 0.0 0.0      0     0?        s<   May07   0:00 [kacpi]    system_u:system_r:auditd_t      root      4022  0.0  0.4 12128   560?        S<SL May07   0:01 auditd    system_u:system_r:auditd_t      root      4024  0.0  0.4  13072   628?        S<SL May07   0:00/sbin/a    system_u:system_r:restorecond_t root      4040  0.0  4.4  10284  5556?        Ss   May07   0:00/usr/sb    Description: In fact, these things we do not care, are selinux built-in. Just learn to convert between forced and loose modes!

CentOS Installation Samba Service

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.