Skip to content

避免可能的供应链攻击危害

  1. 重置权限
shell
# 仅所有者可读写执行
chmod 700 ~/.ssh

# 仅所有者可读写
chmod 600 ~/.ssh/id_*

chmod 644 ~/.ssh/*.pub
chmod 600 ~/.ssh/authorized_keys
  1. 使用 chatt 锁定文件
shell
# +i 表示 immutable (不可变),只有 root 可以解锁
sudo chattr +i ~/.ssh/authorized_keys

# 如果需要解锁
sudo chattr -i ~/.ssh/authorized_keys