File System-Read/etc/passwd order

Source: Internet
Author: User

How did Dongdong in/etc/passwd read it?

first, the inode information of each directory is listed:
root @ Ubuntu: /home/jack # ll-DI/etc/passwd
2 drwxr-XR-x 23 Root 4096 //
655364 drwxr-XR- X 132 Root 12288/etc/
665904-RW-r -- 1 Root 2201/etc/passwd
/etc/passwd as shown in the preceding figure, usually, the top inode number of a filesystem starts from 2.
1)/inode:
Find the inode in the root directory with the inode Number of/dev/hdc2 2 based on the mount point information, the inode standard permission allows us to read the content of the block (with R and X);
2)/block:
after the previous step, obtain the block number and find the inode number (1912545) with the ETC/directory in the block content.
3) inode of ETC/:
Read inode No. 1912545. It is found that vbird has the R and X permissions, so it can read the block content of ETC;
4) block of ETC/:
after the previous step, obtain the block number and find the I with the passwd file. Node number (1914888);
5) inode of passwd:
Read inode No. 1914888 and find that vbird has the r permission, therefore, you can read the content of the passwd block.
6) passwd block:
Finally, read the data of the block.

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.