特定のユーザーまたはIPに対してSSHバナーを無効にする

特定のユーザーまたはIPに対してSSHバナーを無効にする

設定により、パスワードプロンプトの前に表示されるバナーを有効にしましたsshd_config。しかし、一部のユーザー(特に私)は実際にバナーを見る必要はありません(また、多くのスクリプトを混乱させます)。特定のユーザーまたは特定のIPアドレスに対してこれを無効にしたいと思います。どうすればいいですか?

明らかに、これは一般的に現れるフラグであり、抑制/etc/issue.net可能なフラグではありません.hushlogin

ベストアンサー1

ここに例があります。操作方法のMatch詳細については、マニュアルページを参照してくださいsshd_config

抜粋

Match   Introduces a conditional block.  If all of the criteria on the Match 
        line are satisfied, the keywords on the following lines override those 
        set in the global section of the config file, until either another Match 
        line or the end of the file.

        The arguments to Match are one or more criteria-pattern pairs.  The 
        available criteria are User, Group, Host, and Address.  The match 
        patterns may consist of single entries or comma-separated lists and may 
        use the wildcard and negation operators described in the PATTERNS 
        section of ssh_config(5).

許可されるパターンの詳細については、ssh_config「PATTERNS」の下のマニュアルページを参照してください。

抜粋

PATTERNS
        A pattern consists of zero or more non-whitespace characters, ‘*’ 
        (a wildcard that matches zero or more characters), or ‘?’ (a wildcard 
        that matches exactly one character).  For example, to specify a set of 
        declarations for any host in the “.co.uk” set of domains, the following 
        pattern could be used:

           Host *.co.uk

       The following pattern would match any host in the 192.168.0.[0-9] network 
       range:

           Host 192.168.0.?

       A pattern-list is a comma-separated list of patterns.  Patterns within 
       pattern-lists may be negated by preceding them with an exclamation mark 
       (‘!’).  For example, to allow a key to be used from anywhere within an 
       organisation except from the “dialup” pool, the following entry (in 
       authorized_keys) could be used:

          from="!*.dialup.example.com,*.example.com"

はい

Match User user1,user2
  Banner "none"

おすすめ記事