Linux Files cannot be modified or edited by the root user.

Source: Internet
Author: User

Linux Files cannot be modified and edited by the root user. Recently, a company's server was maliciously added some timer tasks to the crond configuration file "/var/spool/cron/root "., in this case, you only need to simply use the crontab-e command to remove the malicious task. However, after the modification, I found that no matter how hard I try to save it, directly modifying the file "/var/spool/cron/root" won't work either. I have a hard time thinking about the power to make it impossible for the root user with the highest power to modify and delete the file. Www.2cto.com later, after a friend of senior Linux clicked it, he knew that the file had lower-level file attributes besides read/write permission control, here, the two commands used to view and change the file properties are lsattr and chattr. Use lsattr/var/spool/cron/root to check whether the file has been added with the sia attribute: s --- ia -------/var/spool/cron/root. Then use: chattr-isa/var/spool/cron/root removes these three attributes to modify the file and successfully remove the malicious task. Www.2cto.com

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.