优化SSH配置(一键完成增加若干参数)

更改ssh服务远程登录的配置。主要的操作是在ssh的配置文件加入下面5行文本到第13行前。(下面参数的具体含义见其他课程。)

Port 52113
PermitRootLogin no
PermitEmptyPasswords no
UseDNS no
GSSAPIAuthentication no

[root@XM ~]# sed '13i Port 52113 PermitRootLogin no PermitEmptyPasswords no UseDNS no GSSAPIAuthentication no' 1.txt
1
2
3
4
5
6
7
8
9
10
11
12
Port 52113
PermitRootLogin no
PermitEmptyPasswords no
UseDNS no
GSSAPIAuthentication no
13
14
15
16
17
18
19
20
[root@XM ~]#

原文地址:https://www.cnblogs.com/Confusedren/p/9785000.html