使用了一下开机代码,
然后开机的时候选择无密钥,
无论是乌班图22或者24,默认用户名还是root,都提示,
disconnected no supported authentication methods available (server sent publickey)
[ol]#!/bin/bash
echo root:123123 |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 iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -P OUTPUT ACCEPT
sudo iptables -F
sudo service sshd restart[/ol]复制代码