first commit
This commit is contained in:
commit
ba848e218d
1001 changed files with 152333 additions and 0 deletions
10
shell/safe/05-sshd.sh
Normal file
10
shell/safe/05-sshd.sh
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
# sshd端口
|
||||
sed -i "/^#Port 22/a\Port $ssh_port" /etc/ssh/sshd_config
|
||||
# 限制root用户远程
|
||||
sed -i '/#PermitRootLogin yes/a\PermitRootLogin no' /etc/ssh/sshd_config
|
||||
# 限制管理用户与应用用户登录。允许manager登录,允许appl_user通过ip_ssh登录
|
||||
sed -i "\$a\AllowUsers $manager $appl_user@$ip_ssh" /etc/ssh/sshd_config
|
||||
|
||||
/bin/systemctl restart sshd
|
Loading…
Add table
Add a link
Reference in a new issue