reallyenglish.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 |
依存関係
なし
例のプレイブック
- 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によって作成されました。