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

巴扎黑
Release: 2017-07-17 09:29:00
Original
2366 people have browsed it

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
Copy after login

 Permanent shutdown

  Open selinux configuration file

vim /etc/sysconfig/selinux
Copy after login

  Change SELINUX to disabled

##  

Restart the computer

reboot
Copy after login

2. Install Samba software

yum install samba* -y
Copy after login

3. Modify the Samba configuration file

Open /etc/samba/smb.conf

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

100 
101     security = user102     passdb backend = tdbsam
Copy after login
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>
Copy after login

4. Close the firewall

Temporarily close

/etc/init.d/iptables stop
Copy after login
Permanently Close

chkconfig iptables off
Copy after login

5. Restart the Samba service

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

chkconfig --level 35 smb on
Copy after login

6. Add a user for the Samba server

First create a normal user

adduser tompasswd tom
Copy after login
Add the user to the Samba service list

smbpasswd tom
Copy after login
 

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template