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 users in Suse Linux by Samba

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

Share

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

This article mainly introduces how to set up users in Samba in Suse Linux. It is very detailed and has a certain reference value. Friends who are interested must read it!

The SAMBA server consists of two parts

Smbd and nmbd;smbd are the kernel of Samba, which are the basis of 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, allowing 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 adding process for Samba users

To 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 create 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.]

The sharing method of Samba

There are two kinds of main use, share and user, here mainly talk about share mode, user mode in the next section focuses on.

[global] setting in smb.conf

Security = share

Guest ok = yes

Guest account = user1

Using share mode, users can log in to the server without entering account number and password, and can specify the default account number for users to log in. Here, 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.

The above is all the content of the article "how to set up users in Samba in Suse Linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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