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

Install and configure Samba Server (CentOS7)

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

Share

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

Suppose we have a demand

Shared name path permissions

Mealkey_Share /smb/docs accessible to all including guests

Group /smb/tech Allow read and write access only to certain groups of users

The group name of the specific group is RD, and currently there is one person named zyy.

1. Install Samba

yum -y install samba samba-client samba-common

2. Create a shared directory (assuming files under the shared/smb directory)

# mkdir -p /smb/docs

# mkdir -p /smb/tech

3. Configure kernel parameters

# ulimit -n 16384

# vi /etc/security/limits.conf

Add the following at the end

* - nofile 16384

4. Configure Samba Server

# vi/etc/samba/smb.conf

Delete everything (vi Delete everything command: Go to the end of the file with G-->ESC-->:1,.d) and add the following:

[global]

workgroup=BIGCLOUD

netbios name=ZZSRV2

server string=Samba Server

#security=share

security=user

map to guest = Bad User

[Mealkey_Share]

path=/smb/docs

# readonly=yes

browseable=yes

guest ok=yes

writable = yes

write list = @RD

[Group]

path = /smb/tech/

public = no

writable = yes

write list = @RD

validusers = @RD

5. Create users and assign permissions

//Create an operating system user

# useradd zyy

# useradd RD

//modify user's group

# usermod -a -G RD zyy

//Create SAMBA User

# smbpasswd -a zyy

//modify directory permissions

# chown RD:RD /smb/tech

# chmod 770 /smb/tech

# chown RD:RD /smb/docs

# chmod 770 /smb/docs

//View service status

# ll /smb/

Start Samba Server

# systemctl restart smb

# systemctl enable smb

# systemctl status smb

7. Testing connectivity

//Testing on Linux

# smbclient -L localhost -U zyyP@

# smbclient //192.168.110.247/Group -U zyy

//Test on Windows

Run Window Input\\192.168.110.247

After opening, you can drag files directly into the directory

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