参考这个文章:
- https://blog.csdn.net/cuichongxin/article/details/117462494
检查一下是不是用户被lock了
输入passwd -s username
如果用户是L状态,那么就是lock了。
使用 passwd -u username
解锁
关于 .bashrc 不生效
有几点:
~/.bashrc
需要执行权限~/.profile
也要执行权限- 在
~/.profile
里面加入这些内容,执行一下bashrc,因为有可能是profile覆盖了bashrc
if [ -f ~/.bashrc ]; then. ~/.bashrc
fi
初始化 .ssh 目录
ssh-keygen
命令生成公钥私钥。
然后创建 authorized_keys
文件,输入你自己笔记本的公钥。
对了,可以在 .bashrc 设置多个authorized_keys 文件。