2017-02-02 3 views
1

開いているsshのログ/ var/log/messagesに他のサーバに接続しているとき。opensshのロジットパスワード。それがどのように働きますか ? sshconnect2.c

sshconnect2.c。

int userauth_passwd(Authctxt *authctxt) 
{ 
    static int attempt = 0; 
    char prompt[150]; 
    char *password; 
    const char *host = options.host_key_alias ? options.host_key_alias : 
     authctxt->host; 

    if (attempt++ >= options.number_of_password_prompts) 
      return 0; 

    if (attempt != 1) 
      error("Permission denied, please try again."); 

    snprintf(prompt, sizeof(prompt), "%[email protected]%.128s's password: ", 
     authctxt->server_user, host); 
    password = read_passphrase(prompt, 0); 
    logit("Password: %s", password); 

    // ... rest of code hidden... 

} 

logit("Password: %s", password);は正しいですか、ログにはインクルードが必要ですか? /var/log/messagesは表示されません...

答えて

0

sshconnect2.cがクライアント側で使用されるため、クライアントはこれを使用してパスワードをログに記録します(デフォルトでは標準エラー)。

パスワードのロギング(正しいか間違っているか)は、セキュリティ上非常に悪いことです。

関連する問題