RT 每个机子一个密钥批量控制太麻烦了 |
sudo -i 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 |
为什么不行? |
当然可以 |
善用搜索,这是可行的 |
#编辑cloud.cfg vim /etc/cloud/cloud.cfg #在最后加入以下代码 #!/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 |
dd就行 |
你发工单问问,看看客服怎么回复 |