參考這個文章:
- 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 文件。