Linux File Permission, chmod

Source: Internet
Author: User

Linux File Permission. the chmod permission symbol indicates the meaning of the number r file: readable path: only the path structure list can be read. 4 w files: Writable Path: add, delete, and move files in the path 2x: executable path: enter this path, access the files in this path 1 s suid: only valid for binary files, for example,/usr/bin/passwdsgid: It is effective for files and paths so that files have the permissions of the owner or group for the moment 42 t sbit: it is mainly effective for paths. Only user-created files can be deleted, for example,/tmp/1 main syntax chmod [option] mode [, mode]... file... chmod [option] octal-mode file... mode: You can change the File Permission in two modes. Symbol mode and octal numeric mode. Symbol mode chmod u (owner) g (Group) o (Others) a (all) + (ADD)-(subtract) = (SET) r (readable) w (writable) x (executable) s (suid/sgid) t (sbit) file octal numeric mode suid/sgid/sbit owner group other chomod 0-70-70-70-7filer = 4, w = 2, x = 1, rwx = 7, rw = 6, rx = 5 suid = 4, sgid = 2, sbit = 1 case 1 change file permissions in two modes, turn this file into an executable file, and others cannot modify the Linux code $ chmod 755 ~ /Testfile $ chmod u = rwx, go = rx ~ /Testfile 2: Add writable permissions for all users to the file. Linux code $ chmod a + w ~ /Testfile 3 uses two modes to grant the suid permission to executable files. Linux code $ chmod 4755 ~ /Testfile // The original permission of testfile is 755 $ chomd u + s ~ /Testfile 4 uses two modes to grant the sgid permission to the path. Linux code $ chomd 2755 ~ /Testpath // The original permission of testpath is 755 $ chmod g + s ~ /Testpath/5 in two modes. Add the sbit permission to the path. Linux code $ chmod 1755 ~ /Testpath // The original permission of tsetpath is 755 $ chmod o + t ~ /Testpath

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.