21 lines
531 B
Markdown
21 lines
531 B
Markdown
###
|
||
```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
|
||
|
||
``` |