authorized_keys 不允许的操作

今天 系统出了问题 导致root 下 文件全部被删除,只剩下    #bash

恢复后,authorized_keys  文件不允许被操作

[root@test_dc_rpdns_com ~]# ssh-copy-id root@10.1.234.4
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
root@10.1.234.4's password: 
sh: .ssh/authorized_keys: 权限不够

 本机无法操作

[root@dp-uat ~]#chmod 600 .ssh/authorized_keys 
chmod: 更改".ssh/authorized_keys" 的权限: 不允许的操作

 查看权限,正常 600

[root@dp-uat ~]#ll .ssh
总用量 12
-rw------- 1 root root  388 3月  25 06:40 authorized_keys
-rw------- 1 root root 1675 3月  25 15:28 id_rsa
-rw-r--r-- 1 root root  393 3月  25 15:28 id_rsa.pub

 无法被删除

[root@dp-uat ~]#rm -rf  /root/.ssh/authorized_keys 
rm: 无法删除"/root/.ssh/authorized_keys": 不允许的操作

 修改后正常

[root@dp-uat .ssh]#chattr -i authorized_keys

 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值