Old boy Education Daily-May 2, 2017-linux system, accidentally put chmod command permission to get lost, how to solve?

Source: Internet
Author: User

Old boy Education Daily-May 2, 2017-linux system, the chmod command does not have Execute permissions (x permission) or chmod command file permissions of 000, how to solve? There are two ways to resolve this:
[email protected] bin]# CP cp/oldboy/chmod.new

(At this point the Copy CP command file is named Chmod.new, at this time the Chmod.new file has permissions on X, but Chmod.new does not have the chmod command of the common function)

[[email protected] bin]# cd/oldboy/[[email protected] oldboy]# cat/bin/chmod > Chmod.new

(The chmod command file with no X permission to the contents of cat to Chmod.new, at this time chmod.new has the same function as chmod)

[[email protected] oldboy]# lltotal 52-rwxr-xr-x 1 root root 52472 May 1 23:09 chmod.new[[email protected] oldboy]#./chm Od.new +x/bin/chmod

(You can grant x permission to the/bin/chmod command with the Chmod.new file)

Method Two:
Use the file's Access Control List feature to authorize the root user to have X permissions

[Email protected] bin]# setfacl-m u:root:rwx/bin/chmod

(This method uses the Access control list method to implement the root user has the permissions of x)

[Email protected] bin]# chmod +x/bin/chmod

(chmod has access to x right now)

Today is the 40th day of the day to accompany you and look forward to your progress .

For questions and answers, please leave a comment in the blog comments section .
Index of the topic of the previous period
http://lidao.blog.51cto.com/3388056/1914205

This article is from the "Lee blog" blog, make sure to keep this source http://lidao.blog.51cto.com/3388056/1921227

Old boy Education Daily-May 2, 2017-linux system, accidentally put chmod command permission to get lost, how to solve?

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