桔子linux连接手机,LinuxSafetyReinforcement.md

## 主机安全加固Host Safety Reinforcement

### Service reinforcement

#### 服务和启动精简

task "ServiceSF", group => "all", sub {

say connection->server.":Service Reinforcement update!";

my @myservices=qw(cups postfix); #add more

for(@myservices) {

run "service $_ stop";

run "chkconfig $_ off";

}

run "chkconfig iptables on";

say connection->server.":upate success!";

};

### sshd reinforcement

### sshd 加固

task "sshd",group =>"all", sub {

say connection->server." begin!";

append_if_no_such_line "/etc/ssh/sshd_config", "PermitRootLogin no";

#Start certificate and forbident passwd login,You must add your key to object host。

# 启用证书登陆,禁止密码登陆,你需要先添加好证书在做此项加固

#delete_lines_matching "/etc/ssh/sshd_config" => "PasswordAuthentication no";

#append_if_no_such_line "/etc/ssh/sshd_config", "PasswordAuthentication yes";

service sshd => "restart";

say connection->server." done!";

};

#### option the sshd login speed

#### 优化sshd登陆速度

task "sshdOP",group =>"all", sub {

delete_lines_matching "/etc/ssh/sshd_config", "#GSSAPIAuthentication no";

delete_lines_matching "/etc/ssh/sshd_config", "#UseDNS no";

append_if_no_such_line "/etc/ssh/sshd_config", "PermitRootLogin no";

append_if_no_such_line "/etc/ssh/sshd_config", "GSSAPIAuthentication no";

append_if_no_such_line "/etc/ssh/sshd_config", "UseDNS no";

service sshd => "restart";

say connection->server." done!";

};

一键复制

编辑

Web IDE

原始数据

按行查看

历史

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值