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

Detailed explanation of samba folder sharing server configuration under centos

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

Share

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

1. Preface

   recently found that it is inconvenient to develop under centos. The code of windows/mac must be synchronized to the folder of centos before it can be compiled. As a result, the work efficiency is low, and a lot of time is spent on code synchronization between window/mac and centos systems. So you want to share the folders in centos to windows/mac, so that you can modify the code under centos directly on window/mac to quickly improve efficiency. Samba server can solve this problem very well, it can let windows and mac users access the shared folders of the local area network as well as the folders under centos.

two。 Configure the samba server

2.1 install samba server

$yum install samba

2.2 set up shared folders

Open the smb configuration file:

Add a shared folder at the end of the file

$[centos_share_folder] comment = share folder# shared folder path = / home/centos/share# specifies the shared folder path available = yes public = yes writable = yes valid users = centos create mask = 755 directory mask = 755 guest ok = no

Then wq saves and exits.

2.3 add users (you can use the current user directly, then there is no need to add users and passwords, skip this step)

$adduser centos

Set password

$smbpasswd-a samba

3 enable smb service

3.1 turn off the firewall

$systemctl stop firewalld.service

3.2 prohibition of setlinux

$vi / etc/sysconfig/selinux set SELINUX=enforcing to disabled$ setenforce 0 # turn off selinux Firewall

3.3 enable samba service

$systemctl start smb.service$ systemctl stop smb.service$ systemctl restart smb.service

3. Verify the smb service

3.1 access to centos shared folder under mac: folder menu-"Connect server -" go to

Smb://192.168.1.53

After the    connection, you are prompted for a user name and password, and after verification, you enter the centos shared folder.

3.2 access to shared folders under windows

/ / 192.168.1.53

After the    connection, you are prompted for a user name and password, and after verification, enter the centos shared folder.

4. Set static IP

During the use of   , it is found that the IP of centos is often changing, which brings a lot of inconvenience to the connection of windows/ Mac. The solution is to set the IP of centos to static IP:

$vi / etc/sysconfig/network-scripts/ifcfg-$eth

Note: $eth can be obtained from ifconfig, if the ifconfig output is: eth0: flags=4163 mtu 150., then $eth=eth0.

After opening it, change it to:

Save and exit the wq after the modification of  , and restart the Nic driver after exiting:

$systemctl restart network

At this point, the smb server has been created successfully, and you can start efficient coding work!

This is the end of this article on the configuration of samba folder sharing server under centos. For more information about samba folder sharing service under centos, please search for previous articles or continue to browse the relevant articles below. I hope you will support it in the future!

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