Create a new user in Linux and assign permissions to the specified file

Source: Internet
Author: User
Tags disk usage

Work in, write a summary of the log.

To create a new user:

The first way:

Create User: AddUser name

Create Password: passwd name (prompt to change password after carriage return)

The user directory created by this method is default under Home.

The second way:

useradd-d/usr/disp-m passwd

This method can establish the user's root path and password when the user is created.

Users created in this way can log on using SSH, but only read-only permissions can be browsed to download portions of the file that cannot be written and modified.

To join the user to the user group:

Useradd-g idsp1-n idsp Adding user groups

(Step optional)

Modify permissions on a file or folder so that new users can have View permissions for the file

chown-774 xxx

XXX represents a file or folder, which defaults to read and write operations only if the group has the highest permissions, and the remaining users have read-only permissions

Other common directives:

    • View end share population with Ps-ef | grep xx

    • Kill the process kill PID

    • Copy all the files in the directory to the new directory

cp -Rf /home/user1/* /root/temp/

Copy everything under the/home/user1 directory to/root/temp/without copying the User1 directory itself. The format is: CP-RF original path/destination path/

    • Search
      Format: Find "search scope" "search condition"; Example: Find/home-name file name; Note: The Find search default is an exact match.
      "" "matches any one of the characters in parentheses, for example: Find/home-name" Test "12" ", displays Test1 and test2 files, or find/home-name" "12", showing files beginning with 1 and 2. Combined use: Example: Find/home-name "" 12 ", showing all files ending in 1 and 2

    • Detecting the disk space occupied by the catalog: Du

    • Detecting disk space occupied by the catalog: the du du command is used to count the size of the disk space that the directory or file occupies, and the command performs the same as DF, where du is more focused on disk usage. The du command is used in the following format: du [options] directory or file name

Detect disk space: The DF DF Command detects disk space usage and availability for the file system, and can display all file system usage of nodes and disk blocks.

Create a new user in Linux and assign permissions to the specified file

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.