rkhunterは、両方のプロファイルが「いいえ」ルートログインに設定されていても、SSHルートログイン警告を発行します。

rkhunterは、両方のプロファイルが「いいえ」ルートログインに設定されていても、SSHルートログイン警告を発行します。

rkhunterそれにもかかわらずsshdrkhunterオプションで警告が表示されます。ルートログインどちらも「いいえ」に設定されています。 rkhunter 1.4.6を使用してCentos 7.6.1810を実行します。

grepの結果は次のとおりです。確認sshdおよびrkhunter構成設定の両方が「no」に設定されています。

$grep PermitRootLogin /etc/ssh/sshd_config  
PermitRootLogin no
$grep ALLOW_SSH_ROOT_USER /etc/rkhunter.conf    
ALLOW_SSH_ROOT_USER=no

わかりやすくするために、プロトコルオプションは次のように設定されます。

$grep Protocol /etc/ssh/sshd_config
Protocol 2
$grep ALLOW_SSH_PROT_V1 /etc/rkhunter.conf
ALLOW_SSH_PROT_V1=0

ログにはrkhunterこれを明確に表示しsshdrkhunter構成はそれを示すように設定されています。ルートログインなしただし、SSHルートアクセスに関する警告が表示されます。

[13:43:33] Info: Using configuration file '/etc/rkhunter.conf'

[13:48:21] Info: Starting test name 'system_configs_ssh'  
[13:48:21]   Checking for an SSH configuration file          [ Found ]  
[13:48:21] Info: Found an SSH configuration file: /etc/ssh/sshd_config  
[13:48:21] Info: Rkhunter option ALLOW_SSH_ROOT_USER set to 'no'.  
[13:48:21] Info: Rkhunter option ALLOW_SSH_PROT_V1 set to '0'.  
[13:48:21]   Checking if SSH root access is allowed          [ Warning ]  
[13:48:21] Warning: The SSH and rkhunter configuration options should be the same:  
[13:48:21]          SSH configuration option 'PermitRootLogin': no  
[13:48:21]          Rkhunter configuration option   'ALLOW_SSH_ROOT_USER': no  
[13:48:21]   Checking if SSH protocol v1 is allowed          [ Not allowed ]  
[13:48:21]   Checking for other suspicious configuration settings [ None found ]  

同様に、rkhunterから受信したEメールでは警告が表示されましたが、設定がすでに同じであることも確認しました。

---------------------- Start Rootkit Hunter Scan ----------------------
Warning: The SSH and rkhunter configuration options should be the same:
         SSH configuration option 'PermitRootLogin': no
         Rkhunter configuration option 'ALLOW_SSH_ROOT_USER': no

----------------------- End Rootkit Hunter Scan -----------------------

rkhunterこの警告の原因と解決策のアイデアはありますか?

ベストアンサー1

それは明らかですsshd_configファイルはDOSテキストファイルです。したがってPermitRootLogin、解析によって設定に割り当てられた値はBUTrkhunterではありません(DOS行の末尾にあるキャリッジリターン文字はオプション値の一部になります)。nono\r

これは、最終的に端末で2つの文字列の表現が同じに見えても、PermitRootLogin値が異なることを意味します。ALLOW_SSH_ROOT_USER

おすすめ記事