linux6改密码失败,centos修改密码提示 authentication token manipulation error

在centos单用户模式下修改root密码提示错误:

authentication token manipulation error

分析是修改密码时要去修改/etc/shadow文件,但是此文件可能出现问题,不能被修改,查看特殊权限(lsattr)里面被添加了一个a位

a位代表append only,只能追加数据,不能修改数据,所以修改密码时报错。

测试a位作用:

root@rootop:~# touch a

root@rootop:~# chattr +a a

root@rootop:~# lsattr a

-----a--------e--- a

root@rootop:~# echo a > a

-bash: a: Operation not permitted

# 提示操作不允许

root@rootop:~# echo a >> a

root@rootop:~# cat a

a

# 追加数据可以

上面a文件的e位在man文档中解释:

extent format (e)

The ‘e’ attribute indicates that the file is using extents for mapping the blocks on disk. It may not be removed using chattr(1).

“e”属性位表示文件正在使用区段映射磁盘上的块。不能使用chattr删除此位。

所以上面的问题,通过chattr去掉a位权限即可。

为什么会多出来个a位权限?

排查是服务器被黑了。

专注于 服务器运维与web架构

E-mail:venus#rootop.org

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值