Linux under Rights Management details

Source: Internet
Author: User

Linux under Rights Management details

    1. Chown command: Change file owner (owner)

      Format: chown [option] User name file (can be modified with multiple files)

      Option:-R for all documents in the document and in the catalogue

      --reference=/path indicated that this document is the main reference.

      For example: Change the owner of the Test.txt file to a willow owner

      Chown Willow/tmp/test.txt

      Change Dir and its subdirectories to Willow Master

Chown-r willow/tmp/dir/

Change the owner of the Test.txt to the owner of the Abc.txt (the following command also modifies the group)

Chown-r--reference=/tmp/abc.txt Test.txt

Note that Chown also modifies the group, which has the following kinds of formatting:

Chown User name: Group name File name

Chown user name. Group Name File name

Chown. Group name File name

Chown: Group name File name

  1. CHGRP command: Change the file Group command

    Format: chgrp [option] Group name file (can be modified with multiple files)

    Option:-R for all documents in the document and in the catalogue

    --reference=/path indicated that this document is the main reference.

    For example: Change the Test.txt file to group1 Group

    Chgrp Group1/tmp/test.txt

    Change the DIR catalog and its subdirectories to group1 group

    Chgrp-r group1/tmp/dir/

    Change the Test.txt group to the group in the Abc.txt

    Chgrp--reference=/tmp/abc.txt Test.txt

  2. chmod command: Change file Permissions command

    Format: chmod [Options] Permissions file (can be modified with multiple files 0

Option:-R for all documents in the document and in the catalogue

--reference=/path indicated that this document is the main reference.

Note: Each file has 3 user rights, has a group, and the others contain rwx rights

For example: chmod 755/tmp/test.txt

chmod u=rwx,g=rx,o=r/tmp/test.txt

chmod a=rw/tmp/test.txt

chmod u+x,g-w,o-x/tmp/test.txt


4. Umask command: Change the Mask password command

Format: Umask three-bit 8-bit,

Note: Execute the above command, effective, the next reboot does not take effect, need to be added to a specific file in order to be permanently effective

The LIUNX system implicitly recognizes all files without performing X-rights, and if the result has Execute permissions, add 1

Limitations of the file =666-umask

Limitations of the Copyright =777-umask

Root Admin user umask for 022

Non-admin user umask for 002

5. Modify config file to add a login user

For example: Mobile Add user Willow,uid to 502, the basic group is Willow,gid 502

5.1.VIM/ETC/PASSWD last add a line:

Willow:x:502:502:willow.xia:/home/willow:/bin/bash

5.2.vim/etc/group last add a line:

willow:x:502:

5.3.vim/etc/shadow last add a line:

willow:!! : 16902:0:99999:7:::

5.4./etc/skel/all documents to/home/willow, i.e., create a home record

Cp-r/etc/skel//home/willow

5.5. Change the master and group of all documents/home/willow and its subdirectories to Willow

Chown-r Willow.willow/home/willow

5.6. Change the group and other rights of/home/willow and its subdirectories to unlimited

Chmod-r go=/home/willow

5.7. Switch Password:

OpenSSL passwd-1-salt ' abcdefgh ' access to MD5 encrypted passwords

Restore this password to the/etc/shadow file.


This article is from the "Willow_xia" blog, make sure to keep this source http://willow.blog.51cto.com/6574604/1762597

Linux under Rights Management details

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.