SUID Special Permissions

Source: Internet
Author: User

SUID special permissions, which are used for binary executables so that ordinary users (others, who have execute privileges) execute this file, temporarily owning the file owner's permission. Binary executables with suid special permissions are displayed in red, and the primary permission execution bit is not X, but s. such as the/USR/BIN/PASSWD command.

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/8B/87/wKioL1hQx23D-KFHAAATN4dmbyw977.png-wh_500x0-wm_3 -wmp_4-s_2330860120.png "title=" 1.png "alt=" Wkiol1hqx23d-kfhaaatn4dmbyw977.png-wh_50 "/>

As you can see, the owner of the/USR/BIN/PASSWD command is root, only because the command has execute permissions on others and has suid special permissions, so the ordinary user can modify their own password, just provide their own old password can be.

Let's look at one more command:/bin/ls, the normal binary executable shows green.

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8B/87/wKioL1hQx3vyY9UAAAAMlW3-uJ4652.png-wh_500x0-wm_3 -wmp_4-s_2066351489.png "title=" 2.png "alt=" Wkiol1hqx3vyy9uaaaamlw3-uj4652.png-wh_50 "/>

Can see,/bin/ls This command of the owner is also root, to other people also have execute permission, but there is no suid special permissions, so ordinary users do this command can not temporarily have the root user's permission to test, the ordinary user is not able to access the/root directory.

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/8B/8B/wKiom1hQx4Tx4IvMAAAS1uah2Ho737.png-wh_500x0-wm_3 -wmp_4-s_4203635544.png "title=" 3.png "alt=" Wkiom1hqx4tx4ivmaaas1uah2ho737.png-wh_50 "/>

We can give LS plus suid special permissions, and then visit/root to see the results.

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/8B/87/wKioL1hQx5mRQlVcAAAXMPNd_Ps485.png-wh_500x0-wm_3 -wmp_4-s_2268355338.png "title=" 4.png "alt=" Wkiol1hqx5mrqlvcaaaxmpnd_ps485.png-wh_50 "/>

As you can see, the average user can now ls/root.

Previously said, must be a binary executable file, other people have execute permissions, the imposition of suid is effective, if the other people do not have permission to execute, even if the owner has SUID special permission is useless.

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M00/8B/87/wKioL1hQx66gqhtMAAAgtMlK3nI069.png-wh_500x0-wm_3 -wmp_4-s_3876270917.png "title=" 5.png "alt=" Wkiol1hqx66gqhtmaaagtmlk3ni069.png-wh_50 "/>

If the owner does not have execute permission, the master execution permission of the command with SUID special permission is shown in uppercase S, because the owner is root, so the normal user can execute it even without the X permission.

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/8B/8B/wKiom1hQx8eAQHTqAAAtIE3P6E4380.png-wh_500x0-wm_3 -wmp_4-s_1424347105.png "title=" 6.png "alt=" Wkiom1hqx8eaqhtqaaatie3p6e4380.png-wh_50 "/>

If the owner is not the root user, the host and others can execute;

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/8B/8B/wKiom1hQx-CxNHdSAAD0xqUsfM4114.png-wh_500x0-wm_3 -wmp_4-s_3809642213.png "title=" 7.png "alt=" Wkiom1hqx-cxnhdsaad0xqusfm4114.png-wh_50 "/>

Remove the owner's X permission, the owner can not execute, but other users can still execute

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8B/87/wKioL1hQx_GQ1aNoAAA_ahbSdzA255.png-wh_500x0-wm_3 -wmp_4-s_2482688077.png "title=" 8.png "alt=" Wkiol1hqx_gq1anoaaa_ahbsdza255.png-wh_50 "/>


SUID Special Permissions

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.