User Access authorization in LINUX

Source: Internet
Author: User
LINUX-based user access authorization-Linux Enterprise Application-Linux server application information. For details, refer to the following section. Since today, the platform has been transferred to linux, and a new beginning has finally been made. Although it is a little late, I am still very happy, the transfer of the platform is a great wish for me to enter the computer field for so long. I am very optimistic about the development prospects of linux. If not, the development momentum of these years has been exceptionally brave, large User usage has created a greater market prospect. Which high-end software has begun to consider supporting the linux platform? It is up to me to make up for and improve my abilities and knowledge in this area!

From now on!

User Access authorization in LINUX-Author: skyzip

1. Create an account

A. The useradd command is recommended.

Usage: useradd username


Create an account: skyzip

Useradd skyzip

B. Create a password

Command: passwd

Usage: passwd password


Assume the password is 123456.

Passwd skyzip press ENTER

New UNIX password: 123456 press ENTER

Bad password: it does not contain enough DIFFERENT characters 'system prompt

Retype new UNIX password: 123456 press ENTER

Passwd: all authentication tokens updated successfully 'system prompt

2. Assign the user a specified location

Usage: vi etc/passwd


Open passwd

Change the statements related to the new user, and abc in the modified statement is the folder to which

Original: google: x: 507: 507:/home/html google:/bin/bash

After modification: google: x: 507: 507:/var/web/www/html/abc:/bin/bash

3. Create the target folder

Run mkdir.

Usage: mkdir directoryname


Create a folder named mkdir abc in a proper location.

In the var/web/www/html/location, mkdir abc

4. Change the owner of the target file

A. Change the file and folder owner

Command: chown

Usage: chown-R username: groupname directoryname

Change the owner of all files and folders in this directory.


Chown skyzip: skyzip abc

Note: The command format must be used at the upper layer of the ABC directory.

After completion, use ls-l to check whether the owner has been changed.

B. Enter the abc directory and enter the following command to change the permission.

Chown-Rf username. groupname directoryname

5. Change folder read/write permissions

Command: chmod

Usage: The specific chmod permission value directoryname (this is to only change the permission of directoryname without affecting the folder and file permissions)

Chmod-Rf specific permission value directoryname (this is the permission to change the directoryname and all folders and files contained)


Chmod 777 abc

Note: The location is var/web/www/html, which is the upper layer of abc. It is set to 777. It is readable and writable because I will upload to this folder and change the file.

Chmod-Rf 777 abc

Note: At this time, the location is var/web/www/html, which is the upper layer of abc. Here it is set to 777. It is readable and writable because I will upload to this folder and change the file, it is dangerous to set all the files and folders in abc to read and write!

6. Test the login of a new user.

Operation completed!
Related Article

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: 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.