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

Change the file permissions and the setting of system permission reservation threshold under Linux

2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

1 understanding of file permissions

File permission read

Permission type-permissions off r (resadable) viewing rights w (writeable) writable rights x (excutable) execution rights this permission is not enabled for files: contents of viewable files for directories: file names can be listed for files changeable contents of file records for files permissions for files available file names call programs recorded in files can enter directories for directories

The way file permissions are set, character mode and digital mode.

Set permission chmod [parameter] in character mode. Permission mode [permission mode]. Target digitally sets file permissions chmod [parameters]. Weight limit. The target copies file permissions chmod [parameters] according to the template. -reference= template target.

Setting permissions in character mode

Chmod target example: chmod u=rw TAG chmod ug-w,o+x TAG chmod a murw TAR

Manage permissions digitally

Permissions can be represented by an octet number

Permission octal-0000--x0011-w-0102-wx0113r--1004r--x1015rw-1106rwx1117

How to manage permissions:

Chmod Digital TAG

Permission replication

Copy permission method chmod-- reference= attribute source file TAG

Example: chmod-reference=/mnt/westso westos1

Use monitoring for more intuitive observation

Note: both 1.chmod and co-p can copy the permissions of the source file to the target file, but in the process of copying, cp-p will overwrite the contents of the target file

The significance of system permission reservation threshold resources lies in sharing, the greater the opening of permissions, the more obvious the sharing effect, but the worse the security is, the less the open power is, the more secure the system is, and the more secure the system should be open in the system. Keep the insecure rights to ensure the functionality and security of the system

766-111-666-666-2-4-6-4-4-4-4-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-2-4-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6-6

777-022 (system reservation) = 755 (directory)-111 (device reservation) = 644 establish the default permission value of a file when the system reservation permission is changed, the default permission value of the establishment file will also be changed

Permission reservation threshold setting

Temporarily set the umask system to use umask to reserve permissions in shell you can use umask to view and set the reserved permission threshold

Permanently change permission threshold shell profile / etc/bashrc system environment profile / etc/profile

1. Temporarily set the permission reservation threshold umask 077 (when you re-open a shell, the permission reservation threshold will not change)

two。 Permanently change the permission reservation threshold, change the information of the location shown in the configuration file / etc/bashrc / etc/profile to change the permission reservation threshold 044 to 022 permanent setting

Determine whether the user's uid is greater than 1999.

three. Source / etc/bashrc

Source / etc/profile

Remind the system that the permission reservation threshold has been changed

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