Linux 脚本配置密码

owner
2024-01-25 / 0 评论 / 48 阅读 / 正在检测是否收录...
#!/bin/bash
echo root:密码 |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 service sshd restart
0

评论 (0)

取消