当前位置:网站首页>Add user error useradd: cannot open /etc/passwd
Add user error useradd: cannot open /etc/passwd
2022-08-11 02:47:00 【cqszpx】
When adding a user in a Linux environment, I found that it could not be added and encountered the following error
useradd: cannot open /etc/passwd
Solution
Use the lsattr command to view the hidden permissions of /etc/passwd
[~]# lsattr /etc/passwd
----i-------e- /etc/passwd
Permission i means that the setting file cannot be deleted, renamed, linked, and cannot be written or added.
Use the chattr command to remove the i permission bit from /etc/group:
[ ~]# chattr -i /etc/passwd
[ ~]# useradd -d /home/test -m test
useradd: cannot open /etc/shadow
Remove /etc/shadow permissions in the same way:
[ ~]# chattr -i /etc/shadow
[ ~]# useradd -d /home/test -m test
[ ~]#
Added successfully

边栏推荐
- Ninjutsu_v3_08_2020 - safety penetrating system installation
- 0图中等 LeetCode565. 数组嵌套
- 深度学习-第二次
- gRPC基础概念:闭包
- How to solve the problem of Tomcat booting and crashing
- 自动生成数据库设计文档利器
- Docker 链接sqlserver时出现en-us is an invalid culture错误解决方案
- 代码 Revert 后再次 Merge 会丢失的问题,已解决
- 2022茶艺师(中级)考试试题及模拟考试
- IDE编译报错:Dangling metacharacter
猜你喜欢
随机推荐
Geogebra 教程之 04 Geogebra 小程序
Realization of vending machine function based on FPGA state machine
否定语义转化层
Research on the Application of Privacy Computing Fusion
2022年G1工业锅炉司炉题库及模拟考试
解决vim与外界的复制粘贴(不用安装插件)
YTU 2411: 谁去参加竞赛?【简单循环】
Deep Learning - Second Time
Oops Framework模板项目新手引导
Logstash日志数据写入异常排查问题总结
OptiFDTD应用:用于光纤入波导耦合的硅纳米锥仿真
comp3331-9331-21t2-midterm复习
"How to kick a bad habit to read notes?
Mysq_Note4
A surviving spouse of the opposite sex within large turn paragraph, what for
Tomca启动闪退问题如何解决
ARM development (4) How to read the chip manual for novice Xiaobai, bare metal driver development steps and pure assembly to achieve lighting, assembly combined with c lighting, c to achieve lighting
数据存储全方案----详解持久化技术
最倒霉与最幸运
js中的this问题









