Change the folder owner to the current group and set folder permissions
Jan 26, 2024 pm 05:03 PMIt is simpler, although you can directly change the owner of the file to the current group China linux, and then add the folder permissions to use the linux format command, that is:
# 將目錄/opt 及其下面的所有文件、子目錄的文件主改成 liuhai chown -R liuhai:liuhai /opt
#給目錄opt設置權限 chmod 760 /opt
Note: In liuhai:liuhai, the second one is the group name. If it is not specified when creating a user, the default is users.
For more details, see Linux gives users permissions to operate a certain folder_linux gives permissions to specified user folders_dhq_blog's blog-CSDN blog
Use user groups to grant users read and write permissions to the specified directory
If the user already has a default user group (generally the group name is the same as the user name) linux authorizes the folder to the user, or already belongs to a user group, you can simply change the file This is done by selecting the user group to which the folder belongs.
#chgrp-Rstorm/usr/local
If you want to rebuild users and user groups and reset permissions, you need to follow the steps below.
1. Create user
#useraddrestart1025
2. Set password
#passwdrestart1025
3. Create user group
#groupaddstorm
4. Set the user group to which the user belongs
#usermod-aGstormrestart1025#addrestart1025tostorm
#groupsrestart1025#checkrestart1025groups
5. Change the user group of the directory to storm:
#chgrp-Rstorm/usr/local
6. Set read and write permissions for group members.
#chmod-R0760/usr/local
#ls-l/usr/local/#checknewpermissions
————————————————
The above is the detailed content of Change the folder owner to the current group and set folder permissions. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Recently, some Windows 10 users have encountered folder permission restrictions during operation. This restriction prevents users from accessing or editing files normally, which brings inconvenience to daily use. In order to help you solve this kind of permission problem, this article will introduce in detail how to lift or modify folder permissions in Windows 10 system so that users can smoothly operate the required files. The following content will guide everyone to understand and learn the specific steps to deal with such problems, please refer to it. Removal method 1. First, you need to find the file on your computer that needs to be revoked, right-click and select "Properties" in the option list. 2. In the window that opens, switch to the "Security" tab at the top and click the "Edit" button. 3. Enter the new

Even simpler, although you can directly change the owner of the file to the current group China linux, and then add the folder permissions, you can use the linux format command, that is: #Change the file owner of the directory /opt and all the files and subdirectories below it. Change to liuhaichown-Rliuhai:liuhai/opt#Set permissions for directory opt chmod760/opt Note: In liuhai:liuhai, the second one is the group name. If not specified when creating a user, the default is users. For more details, see Linux to users Assign permissions to a certain folder operation_Linux gives folder permissions to the specified user_dhq_blog's blog-CSDN blog uses user groups to assign instructions to users

What should I do if there is no security option in Win7 folder properties? A Win7 user wanted to modify the permissions of the folder, but when he opened the properties of the folder, he found that there was no security option. what happened? This situation is usually a problem with system settings. The following small series will tell you how to solve the problem of no security options in Win7 folder properties. 1. Open the start menu, and then enter cmd in the search box, as shown in the figure; 2. Enter the command line: convertX:/FS:NTFS (Note: X represents the drive letter where your folder is located. For example, if your D drive file There is no security option for the folder properties, you can enter convertd:/FS:NTFS) into the command line and then return to the car. . After the system conversion is completed, please re-

Win10 is the latest generation of Windows operating system developed by Microsoft. With the continuous promotion of Microsoft, many friends are now installing and using it. When some users use Win10 to delete folders, they find that the folder cannot be deleted and prompts that administrator rights are required. In order to help More users can use win10 better. The editor has sorted out how to obtain the permissions required to delete folders in windows 10. Now I share it with you. When using a computer, some junk folders will be generated in the computer system. Sometimes when users delete folders, they find that the folder cannot be deleted and requires permissions. What should I do? Don’t worry, the method is actually very simple. The editor will teach you below. How to obtain permission to delete a folder in Windows 10. delete folder

With the continuous development of Internet technology, more and more websites are beginning to use PHP forms to collect and process user information. However, since PHP forms involve user privacy and website security, the correct security solution is crucial for the continued operation and development of the website. In this article, we will introduce a PHP form security solution: using secure folder permission settings. A PHP form is a customized web form that can be used to collect user data and submit it to the server. The most common security concerns when using PHP forms

Sometimes we need to operate some files when operating the computer, but sometimes the computer will prompt that it does not have the corresponding permissions. At this time, we can enter the corresponding disk you want to save to operate. windows10 home version does not have folder saving permissions 1. Find the target disk you want to save, then right-click the disk and select "Properties" 2. After opening, click "Security" above 2. Click "Users (LAPTOP-GELQ6QR8Users)" and click "Edit" ” 3. Just check “Full Control”.

To obtain full control of the Windows folder, you can operate it through the right-click menu or command prompt. First, change ownership and replace child object permissions in the security options of folder properties; second, use the administrator command prompt to execute the takeown and icacls commands for protected folders to force ownership and permissions. Notes include: Ensure that the operation sequence is obtained first and then the permissions are changed, avoid modifying key system directories, and dealing with UAC prompts and hidden folder problems.

To obtain ownership of Windows 10 folders, you can use the property settings, permission grants, and command prompts in turn. The specific steps are as follows: 1. Right-click on folder > Properties > Security > Advanced > Change the owner to the current user and apply to the child object; 2. If it is still inaccessible, you need to edit the permissions in the security options and assign "full control" permissions to yourself; 3. For protected or complex folder structures, run the command prompt as an administrator, enter the takeown and icacls commands to force ownership and grant permissions. Changes may not take effect immediately, restart the system or repeat operations if necessary.
