夜夜夜爽_日本老头与少妇作爱_欧美性高清肥妇喷潮_丰满放荡的寡妇精品一区二区 - 成人免费午夜视频69影院

易秋網絡旗下全球VPS測評站
云主機測評/獨立服務器測評/主機優惠碼

aws lightsail/ubuntu22如何root用戶直接登錄

aws lightsail新建了機子,系統是ubunt22,用了下面的腳本,本以為可以直接root用戶直接登錄機子,結果登錄ssh的時候,報錯。No supported authentication methods available server sent:publickey

#!/bin/bash
echo root:NRSFTjBt8pxZSqX9 |sudo chpasswd root
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
sudo reboot

網上找了下原因,先看看ssh狀態,確定機子是安裝了ssh的。

然后查看機子/etc/ssh/下面的sshd_config文件,下圖顯示白色的2個地方也設置了,按說可以直接ssh登錄的,為啥還是不行呢。

還有個地方需要修改下才可以。

root@ip-172-26-5-146:/etc/ssh# cd sshd_config.d
root@ip-172-26-5-146:/etc/ssh/sshd_config.d# ls
60-cloudimg-settings.conf
root@ip-172-26-5-146:/etc/ssh/sshd_config.d#
nano 60-cloudimg-settings.conf

把里面的PasswordAuthentication no改成PasswordAuthentication yes

然后,重啟ssh服務。

systemctl restart sshd

做完上面的操作,就可以用root用戶直接登錄ubuntu22了

贊(0) 打賞
版權歸求VPS所有,未經允許不準轉載!求VPS » aws lightsail/ubuntu22如何root用戶直接登錄
【聲明】:求VPS,易秋網絡旗下專業VPS測評站,主要側重篩選全球質量比較好的VPS、云主機以及獨立服務器,并且進行簡單測評,僅供參考。因為全國網絡差異較大,求VPS的VPS以及獨立服務器測評數據僅對當時的測評環境有效。求VPS不強制網友購買本站介紹的VPS以及獨立服務器資源,如果網友購買了本站介紹的資源,風險自擔!

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

微信掃一掃打賞