Get the App
SLTechnology News&Howtos  ›  Development  › 

How to set up a shared folder under Linux

Shulou Source: shulou.com Published: 2022-06-01 22:36:04 10月01日 Update

This article is about how to set up shared folders under Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The computers in both the company and the school computer room are in the same local area network. If two computers transfer large files, it may not be convenient to use a flash drive or removable hard disk for fear of poisoning. At this time, the best way is to set up a shared folder. Another computer can access the shared file in the local area network.

First, install Samba yum-y install samba samba-client samba- Common II, modify the Samba configuration file 1. Configure the kernel parameter ulimit-n 16384 vi / etc/security/limits.conf by adding the following at the end *-nofile 16384

Tips: this is mainly to avoid the following warning message when starting Samba:

Rlimit_max increasing rlimit_max (1024) tominimum Windows limit (16384)

two。 Modify the configuration file cd / etc/samba/

Make a backup first, just in case

Cp smb.conf smb.conf.bak

Modify [global] configuration content and add [SHAREDOCS] content.

SHAREDOCS is the name of the shared folder (in this case, no username and password are required to access the shared folder)

[global] workgroup = WORKGROUP netbios name=SHAREDOCS server string=Samba Server security = user map to guest = Bad User [SHAREDOCS] path=/ Note: the value of path is the name of the folder you want to share. Here I chose the root directory writable=yes browseable=yes public= yes guest ok=yesimg 3, restart 3 service systemctl restart smb systemctl enable smb systemctl status smb 4, and let samba pass through firewall 1. Directly turn off the firewall systemctl stop firewalld

If you want to power on and automatically turn off the firewall,

Systemctl disable firewalld2. Configuration / etc/sysconfig/iptables file, add-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 139-j ACCEPT-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 445-j ACCEPT-An INPUT-m state-state NEW-m udp-p udp-- dport 137-j ACCEPT-An INPUT-m state-state NEW-m udp-p udp-dport 138-j ACCEPT

Add the above ports and configure the restart firewall

Systemctl restart firewalld V. Close SELINUX vim / etc/selinux/configimg

Change the value of SELINUX to disabled, and then restart the system

Reboot 6. Enter / / ip in other computer folders in the local area network to access img. Thank you for reading! This is the end of the article on "how to set up shared folders under Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Files folders configuration content computer firewall fire prevention local area network more articles good practical just in case information company kernel parameters available in name Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Huawei Shulou Tech Info Linux Xiaomi