Skip to content

command_chsh

chsh: cannot open xxx/passwd 原因

1. lsattr 查看 xxx/passwd 是否有 i 属性, 用 chattr -i 去掉

2. xxx/passwd 不能是链接文件, 不过出现这种原因建议不要用 chsh 了. 我当时是在 NAS 上用 opkg 安装 chsh 后想改 shell 的, 用了两种方法, 第一个是 cp true_passwd xxx/passwd 但实际上不会改掉, 第二个是直接改 true_passwd 文件结果直接被拒绝 ssh 登录了. 最好的方法是在 .profile 中直接添加两行 /path/to/zsh 和 exit.

Comments