document/文档/linux/root.md
2024-12-04 14:23:41 +08:00

21 lines
531 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

###
```sh
sudo nano /etc/ssh/sshd_config
#找到并修改以下行:
PermitRootLogin prohibit-password
#改为:
PermitRootLogin yes
# 此外,确保以下行存在并且未被注释:
PasswordAuthentication yes
# 重启SSH服务
sudo systemctl restart sshd
# 为root用户设置密码
sudo passwd root
ssh-copy-id -i ~/.ssh/id_rsa.pub root@43.154.208.215
ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.1.34
ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.1.23
ssh-copy-id -i ~/.ssh/id_rsa.pub root@1.15.21.245
```