16. System account and file

Source: Internet
Author: User

Objective

???? has been in the root user, the other users are dead?? Ha ha haha

?

Body

    1. Root user
      1. Root is like administrator in Windows
      2. Each user has a user-specific folder (or not). root directory is special, in/root
      3. The rest of the user's directory is/home/xxxx
    2. Useradd Creating a user
      1. Execute which useradd,/usr/spin

        Ps:

        (1)/bin contains tools that administrators and other users can use

        (2)/usr (Unix software source) represents the installed application catalog

        (3)/usr/bin generally, by default, administrators and other users can use the

???????????? (4)/usr/sbin represents a tool that only administrators can use in the installation software

    1. Useradd Fatsnake

      Ps:

(1) created a user, in the home directory to wear a folder called Fatsnake

  1. Delete User Userdel-r Fatsnake

    If you do not add-r just delete the user, will not delete the relevant files, such as/home/fatsnake

  2. Set Password

    passwd User Name

    Enter two times the same as OK

  3. View User cat/etc/passwd

    Ps:

    Fatsnake:x:500:500:fatsnake:/home/fatsnake:/bin/bash

    1. Split with Colon
    2. The first bit is the username, the second is the password (invisible, encrypted)
    3. The third digit is the user ID, number. The average user starts at 500. The fourth bit is the user group ID. The fifth bit is remark
    4. The sixth bit is the user home directory
    5. The seventh bit is the user's default shell
  4. Create a user group

Groupadd Group Name

Cat/etc/group View Groups

The new user defaults to creating a user group with the same name, and when the group has only one user and you perform the delete operation, the group is gone.

    1. Disable user shell logon

Use usermod-s/sbin/nologin user name

(You can also useradd-s/sbin/nologin user name when you create it)

Ps: A software that only allows a user to be used within the environment, not allowed to log in

?

?

?

End

16. System account and 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.