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 set up samba users in Linux

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

Share

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

This article introduces how to set up samba users in Linux, the content is very detailed, interested friends can refer to, hope to be helpful to you.

User description of samba settings under Suse Linux

The SAMBA server consists of two parts: smbd and nmbd;smbd are the kernel of samba, which are the basis for establishing dialogue, verifying customers and providing file system and printing services; nmbd implements the function of network browsing, and its task is to broadcast the services provided by the Samba server to the local area network. Nmbd makes the Samba server appear in the network neighbors of the windows operating system and allows users to browse the resources that can be used through samba.

Start the smb service under suse:

one. First switch to the root administrator, [su]

two. Enter / etc/init.d, [cd / etc/init.d]

three. Enter the command to start smb, [. / smb start]

After starting the smb service, we can find the samba server by searching ip among the network neighbors under the windows. At this time, the samba can fully provide network sharing services in the local area network. But this server doesn't show up directly because we haven't started the nmbd service yet.

Start the nmbd service under suse:

one. The first two steps are the same as starting the smb service

two. Enter the command to start the nmbd service [. / nmb start]

Example of the process of adding samba users: add a user1 user to samba, first determine whether there is a user1 in the system user, and you can use cat/etc/passwd to check whether there is user1 in the displayed content. If not, you need to create a new user1 system user (because it is troublesome to use commands to establish new users in suse, it is recommended that you use the administrator identity to create a new user in yast2). Enter cd/etc/samba on the terminal to enter the samba directory, command smbadduseruser1:user1_group, and enter the samba password of user1, which should not be the same as the system password of user1. At this point, we have completed the addition of samba users. [you can then use smbpasswd user1 to change the samba password of user1.]

There are two main ways to share samba, share and user. Here we will mainly talk about share, while user will focus on the next section.

Example illustration

[global] setting in smb.conf

Security = share

Guest ok = yes

Guest account = user1

Using share mode, users can log in to Samba server without entering account number and password, and can specify the default account number for users to log in, where users log in through the default user1. After the user logs in, you can see all the files shared by the system and the files shared by user1. Files shared by other users can be seen, but may not be able to use or access. If guest account is not set, users will log in with the default nobody and can only use the shared files set by the system. Files set by other users may not be available.

Samba users and linux users

Linux system users and samba users are interrelated and independent: first of all, samba users must be linux users, which is why we use smbaddusergroup:member to create samba users. Group is a group of linux systems, and member is a linux system user belonging to this group. The prerequisite for adding samba users is that the group and members already exist in the system. Secondly, for the same user, the samba password and the system password are not necessarily the same. In other words, samba users are only used to provide network sharing services, which has nothing to do with operating system users here.

An example shows:

Set in [global] in smb.conf

Security = user

Guest ok = yes

Guest account = user1

[home] Settin

Comment = Home Directories

Valid users =% S

Browseable = No

Read only = No

Create mask = 0640

Directory mask = 0750

Effect: when you enter the samba server in the network neighbor under windows

If the user name and password entered are empty, the user can still enter the samba server, but the identity when entering is the user1 identity of samba, and all the shared files or folders of the user user1 can be seen. The permissions are based on the corresponding permissions of these shared directories set by the system user user1.

If the user name entered is user2 and the password is the system password of user2, the user will enter the user2 directory / home/user2/, where all files can be seen and have all permissions on those files.

If the user name entered by the user is user2 and the password is the samba password of user2, the user can see the directory shared by the system user user2.

On how to set up samba users in Linux to share here, I hope the above content can be of some help to you, you can learn more knowledge. If you think the article is good, you can share it for more people to see.

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