允许使用root用户登录

2022-10-21  本文已影响0人  ag4kd

设置允许使用root用户登录

修改配置文件

sudo vim /etc/ssh/sshd_config

找到并用 "#" 注释掉这行PermitRootLogin prohibit-password,结果如下

# PermitRootLogin prohibit-password

新建一行 添加:

PermitRootLogin yes

重启服务

sudo service ssh restart
systemctl restart sshd.service

设置密码

sudo passwd root

获取SSH公钥

输入命令

ssh-keygen -t rsa -C "601919"

公钥

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDkxXoKCrkjVxgKi8OR9hJ9rLU+t5+Fn6yuGLmvPm5sHanAwlb2adjLB644AtXhPZHeE0EhmcZ5tnrr6eHuTi54QL8EczFj1DkGSA4teBSDIXODJvJO455oSSu8HrBISFH+cw1txiry4LCkABdA1pz4zMMvt9xqQf5BDBUa3NX3oe9HYg4NCakxCi2Yu3qdLb137EncnVB6iyqud4SiVa/D1Y0OMy8mO2v+CYiut/1P6EI1/JaRNCfClPgSc/l0dWC66zS7fl7Tojh8vvcMD8LrxXBjabc7EzSfPbPX0oL/VSl4+Bdum9a0yRWVDRFCY7tqLsYPWVB6IlBOUyzlhbyvCFli9d0eQevCG6RCWaptrKOLsEfSwv2MJZ7dp/4T4dYssKFxnwyMQkOhAawXycl2vRBDoduwLbxVkY/7v7kvz5SA9ddMThVYocaBU9AnvSu29p7MdSoQM3D9Dunal82u57sGd4i+45GEZWgiYAjZfelYm+YkMd5u57VU43MA37c= 601919
上一篇下一篇

猜你喜欢

热点阅读