当前位置:网站首页>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
边栏推荐
- YTU 2411: 谁去参加竞赛?【简单循环】
- Economic Misunderstandings in the Crypto World: Is Cash a Savings?Scarcity creates value?
- Salesforce解散中国团队,什么样的CRM产品更适合中国人
- 基于FPGA状态机的自动售货机功能实现
- 重庆纸质发票再见!开住宿费电子发票即将全面取代酒店餐饮加油站发票
- 漏洞管理计划的未来趋势
- DOM树的遍历-----修改样式,选择元素,创建和删除节点
- Inter-process communication method (2) Named pipe
- AI+医疗:使用神经网络进行医学影像识别分析
- comp3331-9331-21t2-midterm复习
猜你喜欢
随机推荐
Realization of vending machine function based on FPGA state machine
掌握这几招,轻松K.O面试官,Offer拿到吐
【idea 报错】 无效的目标发行版:17 的解决参考
学军中学推理社2017届招新试题
【Unity入门计划】Unity2D动画(1)-动画系统的组成及功能的使用
Mask RCNN 网络详解
思念家乡的月亮
MySQL - 一条SQL在MySQL中是如何被执行的?
①CAS SSO单点登录框架源码深度分析
Vulnhub靶机:GEMINI INC_ 2
Economic Misunderstandings in the Crypto World: Is Cash a Savings?Scarcity creates value?
TRCX:掺杂过程分析
comp3331-9331-21t2-midterm复习
报错处理:org.xml.sax.SAXParseException: 不允许有匹配 “[xX][mM][lL]“ 的处理指令目标
关于地图GIS的一次实践整理(下) Redis的GIS实践
GBJ3510-ASEMI家电电源用整流桥GBJ3510
Mysq_Note4
js中的this问题
shell脚本入门
否定语义转化层