利用下面命令可编写批量执行脚本(如果没有使用自动化工具的情况):
1
2
3
4
5
|
useradd
-u 1111 newuser
sed
-i
'/^root/a\newuser ALL=(ALL) ALL'
/etc/sudoers
sed
-i
's/#PermitRootLogin yes/PermitRootLogin no/g'
/etc/ssh/sshd_config
systemctl restart sshd
passwd
newuser
|
后面会做开发脚本。
本文转自 酥心糖 51CTO博客,原文链接:http://blog.51cto.com/tryingstuff/1924967