跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • 求助,甲骨文用公钥登录以后怎么改成root➕密码登录
未分類
22 6 月 2021

求助,甲骨文用公钥登录以后怎么改成root➕密码登录

简单爱 大佬有话说 :

求助,甲骨文用公钥登录以后怎么改成root➕密码登录

各位吴彦祖,目前是用公钥登录的,不但麻烦,而且登录上去以后在ssh端还不看到文件列表,很头疼。我记得有个命令是用公钥登录以后可以改成用密码登录的,现在找不到了,知道的人麻烦发一下,感激不尽!

cicvc 大佬有话说 :

echo "密码" | passwd –stdin root > /dev/null;sed -i ‘s/#PermitRootLogin yes/PermitRootLogin yes/g’ /etc/ssh/sshd_c*;sed -i ‘s/#PasswordAuthentication yes/PasswordAuthentication yes/g’ /etc/ssh/sshd_c*;sed -i ‘s/PasswordAuthentication no//g’ /etc/ssh/sshd_c*; service sshd restart

未完的歌 大佬有话说 :

首先登录后切换为root,如下命令修改root密码

passwd
依次执行如下代码:

sed -i "s/PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config
sed -i "s/#PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config
sed -i "s/PasswordAuthentication.*/PasswordAuthentication yes/g" /etc/ssh/sshd_config

# 重启sshd服务
systemctl restart sshd

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具