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

What is the meaning of samba in linux

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what is the meaning of samba in linux". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the meaning of samba in linux".

In linux, samba is an open source software based on SMB protocol and a software that enables Linux systems to apply Microsoft network communication protocols. Samba software can be used not only for file sharing between windows and Linux, but also for resource sharing between Linux and Linux.

The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

I. Overview of Samba

1. Brief introduction to samba

Samba is a free software that implements SMB protocol on Linux and UNIX systems, which is composed of server and client programs.

SMB is a communication protocol for sharing files and printers on the local area network. It provides sharing services for files and printers among different computers in the local area network.

SMB protocol is a Cramp S protocol, through which clients can access shared file systems, printers and other resources on the server.

Samba is a software that enables Linux systems to apply Microsoft network communication protocols. The biggest function of samba is that it can be used for direct file sharing and print sharing between Linux and windows systems. Samba can be used not only for file sharing between windows and Linux, but also for resource sharing between Linux and Linux.

Service composition of Samba

1) SMB is the core startup service of samba, which is mainly responsible for establishing the dialogue between the Linux samba server and the samba client, verifying the user's identity and providing access to the file and printing system. Only when the SMB service is started, the file can be shared and the 139th TCP port can be monitored.

2) the NMB service is responsible for parsing, similar to the function implemented by DNS. NMB can correspond to the workgroup name shared by the Linux system with its IP. If the NMB service is not started, it can only access shared files through IP and listen to 137and 138UDP ports.

Install the samba service

Yum-y install samba

Check the installation status

Rpm-qa | grep samba

2. Samba listening port

TCPUDP139 | 445137 |

The service corresponding to the tcp port is the smbd service, which provides shared access to files and print resources in the server.

The service corresponding to the udp port is the nmbd service, which provides resolution based on the NetBIOS host name

3. Samba process

Process corresponds to nmbd corresponds to netbiossmbd corresponds to cifs protocol winbindd + ldap corresponds to Windows AD active directory

4. Samba users

Account password is system user / etc/passwdSamba service password file set / / smbpasswd command through smbpasswd-a USERNAME command:-a Sys_User / / add system user to samba user and set password for them-d / / disable user account-e / enable user account-x / delete User account [root@localhost ~] # yum-y install samba-* [root@localhost ~] # useradd tom [root@localhost ~] # smbpasswd-a tomNew SMB password:Retype new SMB password:Added user tom.

5. Samba security level

There are three security levels for Samba servers, which are user,server,domain

The security level functions user based on local authentication server authenticates the user identity by another designated server domain authenticates by domain control

Previous versions of samba supported four security levels, namely share,user,server,domain

Share is used to set anonymous access, but the current version no longer supports share, but it is still possible to achieve anonymous access, but the configuration has changed.

6. Samba configuration file

/ etc/samba/smb.conf (main profile)

The three components of samba are [global] global configuration. The setting items here are valid [homes] host directory sharing settings for the entire samba server. Here, it is used to set the default share for Linux users, corresponding to the user's host directory. When a user accesses a shared directory with the same name as his user name on the server, it will be automatically mapped to the [printers] printer share settings in the user's host directory after authentication.

7. Common profile parameters

Parameter function workgroup indicates setting workgroup name server string indicates description samba server security indicates setting security level, its values can be share, user, server, domainpassdb backend to set the type of shared account file, and its values can be tdbsam (tdb database file), ldapsam (LDAP directory authentication), smbpasswd (compatible with old version samba password file) comment means to set the comments and description information of the corresponding shared directory That is, the file sharing name browseable means to set whether the share is visible or not. Writable means to set whether the directory is writable or not. Path indicates that the path to the shared directory is accessible to all. Public indicates whether anonymous users are allowed to access write list. Groups are indicated by @. For example, write list = root,@rootvalid users sets users and groups that can be accessed. For example, valid users = root,@roothosts deny sets which host access is denied, for example, hosts deny = 192.168.10.100hosts allow sets which host access is allowed, for example, hosts allow = 192.168.10.200printable indicates whether the setting is a printer # tests whether the configuration file has syntax errors, and displays the configuration that finally takes effect. Use the testparm command [root@localhost ~] # testparmLoad smb config files from / etc/samba/smb.confrlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384) Processing section "[homes]" Processing section "[printers]" Processing section "[print$]" Loaded services file OK.Server role: ROLE_STANDALONE. Second, build an anonymous user sharing server (Linux-Linux)

1. Environmental preparation

IP host system 192.168.10.20serverCentOS7192.168.10.30clientCentOS7systemctl stop firewalld & & systemctl disable firewalldsetenforce 0yum-y install ntp & & ntpdate ntp.aliyun.com//serverhostnamectl set-hostname serversu//clienthostnamectl set-hostname clientsu

two。 Server side

Yum-y install samba-* & > / dev/nullsystemctl start smb & & systemctl enable smb# add global configuration vim / etc/samba/smb.conf. [global] workgroup = SAMBA security = user map to guest = Bad User.# create a shared folder mkdir-p / opt/ycchmod 777 / opt/yc/ll / opt/# configuration shared cat > > / etc/samba/smb.conf / dev/nullsystemctl start Smb & & systemctl enable smb# client verifies that smbclient-L 192.168.10.20-U'Bad User' # 123456mkdir-p / opt/smbmount-t cifs / / 192.168.10.20/yc / opt/smb/-o username='Bad User'df-h# creates a shared directory on the client File cd / opt/smb/ & & touch test & & mkdir yanchuangls

4. Verification on the server

[root@server ~] # cd / opt/yc [root@server / opt/yc] # lstest yanchuang III. Windows accesses shared files

Windows virtual machine access on the same network segment

Windows virtual machine access in different network segments

Authentication required

Thank you for your reading, the above is the content of "what is the meaning of samba in linux". After the study of this article, I believe you have a deeper understanding of what the meaning of samba in linux is, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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