当前位置:网站首页>添加用户报错useradd: cannot open /etc/passwd
添加用户报错useradd: cannot open /etc/passwd
2022-08-11 02:45:00 【cqszpx】
在一个Linux环境添加用户的时候,发现不能添加,遇到了以下错误
useradd: cannot open /etc/passwd
解决方法
用lsattr命令查看/etc/passwd的隐藏权限
[~]# lsattr /etc/passwd
----i--------e- /etc/passwd
权限 i 说明设定文件不能被删除、改名、设定链接关系,同时不能写入或新增内容。
用chattr命令对/etc/group去除i权限位:
[ ~]# chattr -i /etc/passwd
[ ~]# useradd -d /home/test -m test
useradd: cannot open /etc/shadow
用同样的方式去除/etc/shadow 权限:
[ ~]# chattr -i /etc/shadow
[ ~]# useradd -d /home/test -m test
[ ~]#
添加成功

边栏推荐
- redis学习五redis的持久化RDB,fork,copyonwrite,AOF,RDB&AOF混合使用
- 2022制冷与空调设备运行操作考试试题模拟考试平台操作
- YTU 2418: C语言习题 矩阵元素变换
- AI+医疗:使用神经网络进行医学影像识别分析
- 花甲的思考
- 小幻美图 API
- 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
- gRPC基础概念:闭包
- comp3331-9331-21t2-midterm复习
- CSAPP Data Lab
猜你喜欢
随机推荐
3342: String manipulation problem solving
Fatal error in launcher: Unable to create process using xxx --logdir logs(tensorboard使用)
async和await的理解和用法
Entity到Vo的转换
网络安全笔记第四天day4(kali基本操作)
Summary of Logstash log data write exception troubleshooting
gRPC闭包调度器
Geogebra 教程之 04 Geogebra 小程序
维特智能惯导配置
[机缘参悟-66]:怎样才能让别人愿意帮你:利益共享法则、“大道”、“人性”
ES进阶 函数功能语法新特性详解
Realization of vending machine function based on FPGA state machine
2022年广东省安全员A证第三批(主要负责人)操作证考试题模拟考试平台操作
《人生若如初见》命运多舛,人物饱满,朱亚文角色反差太惊喜
超声三维重建总体架构
117. 本地开发好的 SAP UI5 应用部署到 ABAP 服务器时,中文字符变成乱码的原因分析和解决方案
JVM类加载机制
全局大喇叭--广播机制
WeChat public account background management
What does the sanction of the mixer Tornado mean for the DeFi market?









