OK源码中国资源网:如果你的目的是 Ubuntu 24.04 开启 root SSH 登录,可以直接执行下面这一组命令

sudo passwd root

sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/' /etc/ssh/sshd_config

sudo find /etc/ssh/sshd_config.d -type f -exec sed -i 's/^PasswordAuthentication no/PasswordAuthentication yes/g' {} \;

sudo systemctl restart ssh

发表回复

后才能评论