当前位置:网站首页>添加用户报错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
[ ~]#
添加成功

边栏推荐
- 2022年广东省安全员A证第三批(主要负责人)操作证考试题模拟考试平台操作
- YTU 2411: 谁去参加竞赛?【简单循环】
- 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
- ROS源代码阅读(1)
- DOM-DOM树,一个DOM树有三种类型的节点
- 带你系统学习MySQL索引
- Salesforce解散中国团队,什么样的CRM产品更适合中国人
- 漏洞管理计划的未来趋势
- The practice of alibaba data synchronization component canal
- [oops-framework] Template project [oops-game-kit] Introduction
猜你喜欢
![报错处理:org.xml.sax.SAXParseException: 不允许有匹配 “[xX][mM][lL]“ 的处理指令目标](/img/35/650c92ac4c5fc2d5826f3216a09e65.png)
报错处理:org.xml.sax.SAXParseException: 不允许有匹配 “[xX][mM][lL]“ 的处理指令目标

Matlab矩阵(数组)元素过滤常见方法详解

Logstash日志数据写入异常排查问题总结

The practice of alibaba data synchronization component canal

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

MySQL - an SQL in MySQL is how to be performed?

google搜索技巧——程序员推荐

学军中学推理社2017届招新试题

Vim and copy and paste from the outside (don't need to install the plugin)

基于FPGA状态机的自动售货机功能实现
随机推荐
MySQL的主从复制+读写分离+分库分表,看这一篇文章就够了
深度学习-第二次
Ninjutsu_v3_08_2020-安全渗透系统安装
Mask RCNN 网络详解
ESP32的环境配置(arduino arduino2.0 VScode platform哪个好用?)
Mysql_Note6
2022制冷与空调设备运行操作考试试题模拟考试平台操作
DOM-DOM树,一个DOM树有三种类型的节点
项目构建工具-Gradle入门
YTU 2418: C语言习题 矩阵元素变换
自动生成数据库设计文档利器
Entity到Vo的转换
Js prototype and prototype chain and prototype inheritance
Detailed explanation of common methods of filtering matrix (array) elements in Matlab
花甲的思考
数论基础-整除(编程例题)
Future Trends in Vulnerability Management Programs
如何开展性能测试,你知道吗?
对加密世界的经济误解:现金是储蓄?稀缺性创造价值?
(Nips-2015)空间变换器网络