adambirds.configure-sshd

ansible-role-sshd

sshdを設定します。

要件

なし

変数

変数 説明 デフォルト
sshd_user sshdのユーザー名 sshd
sshd_group sshdのグループ名 {{ __sshd_group }}
sshd_service sshdのサービス名 {{ __sshd_service }}
sshd_conf_dir sshdの設定ファイルが格納されているディレクトリのパス {{ __sshd_conf_dir }}
sshd_conf sshd_configのパス {{ sshd_conf_dir }}/sshd_config
sshd_sftp_server sftp-server(8)のパス {{ __sshd_sftp_server }}
sshd_config sshd_configの辞書 {"PermitRootLogin"=>"without-password", "PasswordAuthentication"=>"no", "UseDNS"=>"no", "UsePAM"=>"no", "Subsystem"=>"sftp {{ sshd_sftp_server }}"}
sshd_config_pre sshd_config(5)の前の文字列 ""
sshd_config_post sshd_config(5)の後の文字列 ""
sshd_config_match Matchキーワードのリスト []

ssh_config_match

この変数は辞書のリストで、Matchブロックを作成します。

キー
condition Matchの条件
keyword 指示語と値のペアの辞書

例:

sshd_config_match:
  - condition: User foo
    keyword:
      X11Forwarding: "yes"

これにより、次のブロックが生成されます:

Match User foo
  X11Forwarding yes

Debian

変数 デフォルト
__sshd_group ssh
__sshd_conf_dir /etc/ssh
__sshd_sftp_server /usr/lib/sftp-server
__sshd_service ssh

FreeBSD

変数 デフォルト
__sshd_group sshd
__sshd_conf_dir /etc/ssh
__sshd_sftp_server /usr/libexec/sftp-server
__sshd_service sshd

OpenBSD

変数 デフォルト
__sshd_group sshd
__sshd_conf_dir /etc/ssh
__sshd_sftp_server /usr/libexec/sftp-server
__sshd_service sshd

RedHat

変数 デフォルト
__sshd_group ssh
__sshd_conf_dir /etc/ssh
__sshd_sftp_server /usr/lib/sftp-server
__sshd_service sshd.service

依存関係

なし

例 Playbook

- hosts: localhost
  roles:
    - ansible-role-sshd
  vars:
    sshd_config:
      PermitRootLogin: without-password
      PasswordAuthentication: "no"
      Port: 22
      UseDNS: "no"
      UsePAM: "no"
      Subsystem: "sftp {{ sshd_sftp_server }}"
    sshd_config_match:
      - condition: User foo
        keyword:
          X11Forwarding: "yes"
      - condition: User bar
        keyword:
          X11Forwarding: "no"
    sshd_config_pre: |
      Port 2022
    sshd_config_post: |
      Match Address 192.168.1.1
        PasswordAuthentication yes

ライセンス

Copyright (c) 2016 Tomoyuki Sakurai <tomoyukis@reallyenglish.com>

このソフトウェアを利用、コピー、変更および配布する権利は、料金の有無にかかわらず、上記著作権表示および本許可通知がすべてのコピーに表示される限り、付与されます。

このソフトウェアは「現状のまま」で提供され、著者は、このソフトウェアに関して商業性や適合性に関するすべての暗黙の保証を否認します。著者は、このソフトウェアの使用またはパフォーマンスに起因または関連するいかなる特別、直接、間接、または結果的な損害にも責任を負わないものとします。

作成者情報

Tomoyuki Sakurai tomoyukis@reallyenglish.com

このREADMEはansible-role-initによって作成されました。

プロジェクトについて

Configures sshd

インストール
ansible-galaxy install adambirds.configure-sshd
ライセンス
isc
ダウンロード
84
所有者
I am a Python and TypeScript Developer. Currently studying for a Computing & IT (Software) degree. Owner of @adb-web-designs and @VastDesk.