The solution for useradd: cannotopenshadowpasswordfile-Linux Enterprise Application-Linux server application information is displayed. For details, see the following. When adding users today
# Useradd test
Useradd: cannot open shadow password file
At first, the permission for the/etc/shadow file was mistakenly modified. view the/etc/passwd and/etc/shadow attributes.
[Root @ mango root] # ls-rlt/etc/passwd
-Rw-r -- 1 root 1726 March 20 17:43/etc/passwd
[Root @ mango root] # ls-rlt/etc/shadow
-R -------- 1 root 1262 March 20 17:43/etc/shadow
Normally, the following attributes can be added.
Ls-rlt/etc/passwd
-Rw-r -- 1 root 1831 2013-03-20/etc/passwd
[Guest @ www5 guest] $ ls-rlt/etc/shadow
-R -------- 1 root 1294 2013-03-20/etc/shadow
Change/etc/shadow of the faulty host to 600. An error is returned. do not modify the host!
[Root @ mango root] # chmod 600/etc/shadow
Can not modify
After asking the security specialist, I realized that I had performed security reinforcement. I could use lsattr and chsttr to change the attributes!
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