当前位置:网站首页>添加用户报错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
[ ~]#
添加成功
边栏推荐
- CSAPP Data Lab
- “京台高铁”亮相百度地图,真能在2035年建成吗?
- 【C 数据存储详解】(1)——深度剖析整形数据在内存中的存储
- LitePal操作数据库
- 通过微透镜阵列的传播
- shell [stdin/stdout/stderr][重定向]
- CC0 与商业 IP:哪种模式更适合 NFT?
- The classification of inter-process communication (IPC) and the development of communication methods
- Detailed explanation of new features of ES advanced function syntax
- 0 in the figure, etc. LeetCode565. Array nesting
猜你喜欢
CSAPP Data Lab
如何开展性能测试,你知道吗?
想进阿里?先来搞懂一下分布式事务
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
如何解决高度塌陷
【C 数据存储详解】(1)——深度剖析整形数据在内存中的存储
[4G/5G/6G专题基础-154]: 5G无线准入控制RAC(Radio Admission Control)
ES进阶 函数功能语法新特性详解
How to solve the problem of Tomcat booting and crashing
阿里亿级并发册 + 机器学习算法 + 面试册 + 优化册 + 代码册 笔记!!!
随机推荐
Matlab矩阵(数组)元素过滤常见方法详解
压力能变成动力
Multi-threaded ThreadPoolExecutor
alibaba数据同步组件canal的实践整理
Future Trends in Vulnerability Management Programs
【idea 报错】 无效的目标发行版:17 的解决参考
Oops Framework模板项目新手引导
全局大喇叭--广播机制
[oops-framework] Template project [oops-game-kit] Introduction
超声三维重建总体架构
行业的思考
Salesforce解散中国团队,什么样的CRM产品更适合中国人
Mysql_Note5
带你系统学习MySQL索引
网络安全笔记第四天day4(kali基本操作)
Oops novice template Framework project guide
微信公众号后台管理
DOM树的遍历-----修改样式,选择元素,创建和删除节点
js原型和原型链及原型继承
comp3331-9331-22t1-midterm复习辅导-tutorial week 5