Samba principle-usernames

Source: Internet
Author: User
Tags file permissions

Samba deploys the shared file service on a Linux server and then accesses it on Windows. For access, the user's authentication Linux is different from Windows. 1. Linux User mode

Linux is generally divided into the following user modes: 0: Shutdown 1: Single-user Mode 2: Multiuser mode with no network support: Multiuser mode with network support 4: reserved, not used 5: Supported multiuser mode with network support X-window 6: Reboot the system, restart

When the Linux system is in a normal state, the server host is powered on (or restarted), and the system bootstrapper program can automatically boot the Linux system to multi-user mode and provide normal network services. Special Note: Enter Single-user mode, do not turn on network service, do not support remote connection

The different running levels (run level) in the Linux system represent the different running states of the system, for example, when the Linux server is running at run Level 3, a multiuser mode that can provide network services, and run Level 1 allows the administrator to operate through a single console of the server host, that is, " Single user Mode ". 2. linux file Permissions

The Linux file's metadata saves the file's permissions mod, creating the file's Uid,gid.

[U1@localhost test]# stat file1 
  file: ' file1 '
  size:2           blocks:8          IO block:4096 regular   file
device:fd00h/64768d    inode:134382061   links:1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
access:2017-09-19 01:38:17.517410401-0700
modify:2017-09-19 01:38:14.854274421-0700
change:2017-09-19 01:38:14.854274421-0700
 Birth:-You
have new mail in/var/ Spool/mail/root
[U1@localhost test]#

If the file file1 above has read and write access to it, the user group and other users have reading permissions. You should also note that Uid/gid is stored in the metadata of the file. If you switch other users and write the file, an error will be made.

[Root@localhost test]# su u1
[u1@localhost test]$ ll Total
4
-rw-r--r--1 root root 2 Sep 01:38 File1
  [u1@localhost test]$ echo "1" > File1
bash:file1:Permission denied

The above user U1 is the Linux multiuser mode, a user. Therefore, if you access Linux from a network (Windows client), you also need to provide a username.
However, we should also note that in the Linux local access, has logged into the U1 user state, U1 initiated the read and write operation will be U1 Uid/gid as part of the request and metadata to access files in the Uid/gid do comparison, do authority authentication. Then the network to request how to do the user's authorization to authenticate it. 3.SAMBA user Authentication

Requests from the Windows client, the SMBD process on the Linux server receives the request. Because different requests may contain different user names, permissions, SMBD needs to provide a conversion function. Converts the user in the Windows access request to UID and saves it. If the Windows user Admin1 creates a file in the Smaba shared directory, the metadata for that file should save the Uid/gid converted Admin1 in SMBD.

However, the components that perform user conversion are not SMBB, but other components, followed by step-by-step instructions.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.