Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build file sharing service Samba under CentOS6.5

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how to build file sharing service Samba under CentOS6.5. I hope you will get something after reading this article. Let's discuss it together.

Samba Service:

Case description:

The administrator of a company needs to set up a SAMBA server, and customize the IP address and the allowed access network segment. The security level of the SAMBA server is user, and the workgroup is WORKGROUP, so that added users can access their personal directory and shared directory / smb_share, and can read, write, and execute directories.

1.SMB Protocol and the working principle of SAMBA Server

SAMBA supports SSL for secure communication and LDAP for identity authentication based on directory services. SAMBA server can also act as PDC and member server in Linux domain, and can manage Windows computer and Linux workstation on Windows server.

SMB is based on client / server protocol, so a SAMBA server can act as both a file sharing server and a SAMBA client, that is, Windows clients can access shared resources on SAMBA servers set up under Linux through SMB protocol, and the SAMBA server can also access resources shared by other Windows systems or Linux systems in the network.

Configuration files and configuration items for the 2.SAMBA service

Configuration file: / etc/samba/smb.conf

Configuration item: Network Related Options Share Definitions

3. Environment

CentOS 6.5OS / VMware software (server side), Windows operating system (client side)

4. The specific steps are as follows

1. View the samba server: rpm-Q samba

two。 Turn off the firewall: service iptables stop

3. Load virtual CD: virtual machine-- > removable device-- > CD/DVD-- > connection

4. Modify the yum (download) file: / etc/yum.repos.d/CentOS-Media.repo

5. Mount CD: mount-t iso9660 / dev/sr0 / mnt

6. Install the samba server: yum install-y samba

7. Query whether samba has successfully installed rpm-q samba (rpm-qa | grep samba)

8. Modify the samba configuration file: / etc/samba/smb.conf

9. Add a shared folder: mkdir / mydoc, and modify the smb.conf file again: vim / etc/samba/smb.conf

10. Add samba working group: groupadd smbusers

11. Add samba users (this user cannot log in to the server system): useradd-g smbusers-s / sbin/nologin smbuser1

twelve。 Set the samba user password: smbpasswd-a smbuser1

13. Set permissions for the mydoc shared folder you just set:

Chown-R smbuser1:smbusers / mydoc

Chmod-R 777 / mydoc

14. View directory permissions: as shown below:

15. Turn off the mandatory mode of SELINUX: setenforce 0

Or vi / etc/sysconfig/selinux change SElinux = enforcing to SElinux = disabled

16. Restart the service: service smb restart service nmb restart

17. Connect to samba server: enter\\ ip address for win+R

18. View the folder:

5. experience

1. Try several more times when logging in to a shared folder due to network problems.

two。 To set the permissions for a shared folder, use the command (ll-a) to view the folder's access users and groups, and to view it as follows:

Drwxrwxrwx. 2 smbuser1 smbusers 4096 Apr 22 03:49 mydoc

After reading this article, I believe you have a certain understanding of "how to build file sharing service Samba under CentOS6.5". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report