Samba File Server Installation Configuration
Before installation, you can view your liunx system version and system type to prepare the corresponding software version. view the kernel version details, including host name 1 # uname-a installation in either of the following ways: 1. rpm command installation. The rpm-ivh installation package is usually installed by mounting the installation package Image 2. yum command. This method is demonstrated here. Please make sure that the virtual machine can be connected to the local machine and can ping each other. I. Environment preparation: CentOS 6.2 (32-bit) IP Address: 192.168.153.66 (Virtual Machine); Virtual Machine: VMware-workstation-full-8.0.0-471780; samba software: samba-3.6.23-20.el6.i686; Working Group: WORKGROUP. // Define the name of the computer displayed in windows 2. Install software 1. run the following command to install samba: 1 # yum install samba-client samba-swat 2. check whether samba is successfully installed: 1 # rpm-qa | the installation directory of grep sambasamba is usually in/etc/samba 3. start the samba service and check the status: #/etc/init. d/smb start4. set auto-start upon startup and check whether the setting is successful: -- set # chkconfig-level 35 smb on # chkconfig-level 35 nmb on -- view # chkconfig-list | grep smb III. service configuration Samba service configuration mainly refers to/etc/samba/ smb. conf file configuration. Here I will only demonstrate one of the simplest sharing methods (which can be accessed without a user name or password). For other configurations, click (more methods) for reference configuration. 1. redirects the configuration file to a file and backs up smb. conf source file 1 # grep-v "^ [#;]" smb. conf | grep-v "^ $"> smb.conf.txt 2 # cp smb. conf smb. conf. copy3 # mv smb.conf.txt smb. conf2. modify the main configuration file smb of the samba server. conf
1 [global] 2 3 workgroup = WORKGROUP 4 server string = Samba Server Version %v 5 netbios name = VMQiheng 6 7 # logs split per machine 8 log file = /var/log/samba/log.%m 9 # max 50KB per log file, then rotate10 max log size = 5011 12 # max 50KB per log file, then rotate13 max log size = 5014 15 security = share16 passdb backend = tdbsam17 18 # the login script name depends on the machine name19 # the login script name depends on the unix user used20 # disables profiles support by specifing an empty path21 22 load printers = yes23 cups options = raw24 #obtain list of printers automatically on SystemV25 26 [homes]27 comment = Home Directories28 browseable = no29 writable = yes30 31 [printers]32 comment = All Printers33 path = /var/spool/samba34 browseable = no35 guest ok = no36 writable = no37 printable = yes38 39 [beyond]40 comment = Public share with beyond file41 path = /share42 public = yes43 writable = yes
The above is the conf settings of my samba server. In the configuration file, I added the [beyond] node and shared the share folder 2 under the root directory of liunx. 1. create a shared directory # mkdir secrets 2.2. grant the shared directory the nobody permission # chown-R nobody: nobody/secrets 3.restart smb service: 1 #/etc/init. d/smb restart2 #/etc/init. d/nmb restart if the configuration is successful, you can access the shared folder [beyond] through the liunx ip address, which is the shared directory that I configured for access in Windows. Possible problems. 1. If you use windows to access the linux shared directory, for example, 192.168.100.88, you cannot find it. Disable the linux Firewall: # service iptables stop. 2. the shared folder is displayed, but the folder cannot be opened (on the left) or the # smbclient/127.0.0.1/beyond (on the right) is blocked by SELinux in liunx, you can use getenforce to view the status. If it is Enforcing, use setenforce 0 to disable it. However, the next time I start liunx, When I access the liunx ip address on windows, I still need to have two questions about appeal. I have to reset it again, which is troublesome, I don't know if liunx is familiar with liunx. Please leave a message. At this point, the samba server is successfully installed. It is a tough task for me to be a cainiao. I hope this will be helpful to you. If it helps you solve the problem, please do not likes it. I will be more motivated to summarize it.