Home >Operation and Maintenance >Linux Operation and Maintenance >Detailed explanation of relevant knowledge points about setting up Red Hat 6.5 Samba server

Detailed explanation of relevant knowledge points about setting up Red Hat 6.5 Samba server

巴扎黑
巴扎黑Original
2017-07-17 09:29:002388browse

The purpose of building a Samba server is to realize that after the Linux shared directory can be directly accessed from Windows, the shared directory can be accessed directly.

Now we will introduce how to set up Samba service in Red Hat 6.5 system.

Before building the Samba service, the yum source must be configured, both local and network sources are acceptable.

1. Close the selinux service

This service must be closed, otherwise Windows will not have access rights.

 Temporary shutdown

  It is only effective for the current time. After the computer is restarted, the service will be restarted, so it is generally selected to be permanently shut down.

setenforce 0

 Permanent shutdown

  Open selinux configuration file

vim /etc/sysconfig/selinux

  Change SELINUX to disabled

##  

Restart the computer

reboot

2. Install Samba software

yum install samba* -y

3. Modify the Samba configuration file

Open /etc/samba/smb.conf

vim /etc/samba/smb.conf
In about line 100 of the configuration file, change security to user

100 
101     security = user102     passdb backend = tdbsam
Add the following content at the end of the configuration file

<span style="color: #000000">#共享时显示的文件夹名字,要顶格写<br>[need]        <br>  #对该共享目录的描述,任意写                  <br>  comment =<span style="color: #000000"> need share    <br>  #指定<span style="color: #000000">共享的目录路径 
  path = /<span style="color: #000000">share<br><span style="color: #000000">  #是否让所有可以登入的使用者看到
  public =<span style="color: #000000"> yes              <br><span style="color: #000000">  #表示可写,能够上传删除等操作,该共享目录的其他用户也必须具备同样的权限 
  writable =<span style="color: #000000"> yes              <span style="color: #000000"><br>  #<span style="color: #000000">该共享目录是否可见
  browseable = yes   <br>  #不能匿名访问,需要登录       <span style="color: #000000">  guest ok = no              </span></span></span></span></span></span></span></span></span></span></span>

4. Close the firewall

Temporarily close

/etc/init.d/iptables stop
Permanently Close

chkconfig iptables off

5. Restart the Samba service

/etc/init.d/smb restart
Start automatically after booting

chkconfig --level 35 smb on

6. Add a user for the Samba server

First create a normal user

adduser tompasswd tom
Add the user to the Samba service list

smbpasswd tom
 

7. Windows access

You can see that there are two shared directories, one is the shared directory we set up ourselves. One is the home directory of the currently logged in user. The home directory is automatically shared and does not require us to set it.

The above is the detailed content of Detailed explanation of relevant knowledge points about setting up Red Hat 6.5 Samba server. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn