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

The configuration method of Samba server on the server of Linux system

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

Share

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

This article mainly introduces "Samba server-side configuration method on Linux system server", in daily operation, I believe many people have doubts on Samba server-side configuration method on Linux system server, Xiaobian consulted all kinds of information, sorted out simple and easy to use operation method, hope to answer "Samba server-side configuration method on Linux system server" doubts helpful! Next, please follow the small series to learn together!

Samba Server Configuration Section

Step 1:

Go to/etc/samba directory, backup smb.conf, and then delete this file, create a new one yourself, enter the following content

The code is as follows:

[global]

workgroup = WORKGROUP

netbios name = www.e2fsck.org #The key point here, this name is best the same as the machine name, remote access when using this name

server string = e2fsck is samba server

security = share

load printers = no #Do not load printers

disable spoolss = yes #hide printer

cups options = raw #printer type

unix charset = utf8

dos charset =GBK

display charset = utf8

client lanman auth = yes

client plaintext auth = yes

hosts deny = 192.168.0.55 #Block this IP from accessing SMB

The code is as follows:

[wujie]

path = /var/wujie

writeable = yes

browseable = yes

guest ok = yes

Simply explain the above content [global] global configuration, must have. The first three lines are all showing what to say. If security is share, it means no account password. If it is user, it means authentication.

[wujie] This is the shared directory displayed on the client side, path is the shared path, guest ok is yes is no authentication.

Step 2:

Create a folder called wujie in/var/directory for shared folders

The code is as follows:

[root@localhost ~]# id nobody

uid=99(nobody) gid=99(nobody) groups=99(nobody)

[root@localhost ~]# chown -R nobody:nobody /var/wujie

OK, then restart SMB server service smb restart and service nmb start A simple shared server without authentication is done.

Step 3: Create a shared server that requires an account password

1. First use the command useradd wujie -s /sbin/nologin (the system establishes an account called wujie and cannot log in to the system)

2. Then use smbpasswd -a wujie (use this command to add an SMB account called wujie)

3. chown wujie:wujie /var/wujie (make wujie account have permission to use/var/wujie directory)

4. Then modify/etc/samba/smb.conf:

The code is as follows:

[global]

workgroup = WORKGROUP //used to specify NT domain names on the network on your machine

netbios name = www.e2fsck.org, address used to access, important

server string = e2fsck is samba server

guest account = wujie //If you want to create an account, fill in the user name again, and add this account in/etc/passwd, otherwise use the default 'nobody' as the account

security = user

//This is the security level of the samba server. The default is user level. Samba has four levels of security.

1. Share level, shared security level, users do not need to enter an account and password can log in

2. user level, user security level, users need an account and password to log in

3. server level, server security level, password checking can be done by specifying another samba server

4. Domain security level, you need to specify an XP server to verify the user password

The code is as follows:

unix charset = utf8

dos charset = GBK

display charset = utf8

client lanman auth = yes

client plaintext auth = yes

[wujie]

path = /var/wujie

writeable = yes

browseable = yes

guest ok = no //password required, yes means no password required (security level required)

comment = wujie

valid users = wujie //accessible users

public = no //anonymous users do not see

create mask = 0777

The main thing is to change security to user guest ok to no

5. Finally, service smb restart and service nmb start, thus making a shared file server with command access.

6. If it's open, the firewall's open.

The code is as follows:

[root@s ~]# iptables -A INPUT -p tcp –dport 139 -j ACCEPT

[root@s ~]# iptables -A INPUT -p tcp –dport 445 -j ACCEPT

[root@s ~]# iptables -A INPUT -p udp –dport 137 -j ACCEPT

[root@s ~]# iptables -A INPUT -p udp –dport 138 -j ACCEPT

[root@s ~]# iptables -A INPUT -i lo -j ACCEPT

At this point, the study of "Samba server-side configuration method on Linux system server" is over, hoping to solve everyone's doubts. Theory and practice can better match to help you learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

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