SShd 設定

SSH 伺服器的設定檔是 /etc/ssh/sshd_config,以下是一些 SSH 的安全配置:

為了加強SSH安全性, 除了限制root帳號登入這種必備的手段之外, 還參照了前輩們的做法, 從三部分來著手:

59.125.229.7: root nologin

2 3 6 8  modify /etc/hosts.allow and /etc/hosts.deny only 2-14

這是一個很簡單的設定手段, 除了限制root之外, 還順便限制連線數, 如下:

#LoginGraceTime 2m
PermitRootLogin no
#StrictModes yes
MaxAuthTries 2

# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
PermitEmptyPasswords no
PasswordAuthentication yes

# ChallengeResponseAuthentication=no
#UsePAM no
UsePAM yes

Tags