claranet.sshd

Ansible 角色 - sshd

维护者 许可证 发布 状态 Ansible 版本 Ansible Galaxy

:star: 请在 GitHub 上给我们加星 - 这会对我们有很大激励!

安装和配置 SSHd。管理证书授权机构。

:warning: 要求

Ansible >= 2.10

:zap: 安装

ansible-galaxy install claranet.sshd

:gear: 角色变量

变量 默认值 描述
sshd_trustedusercakeys_content 可信用户密钥证书授权机构的内容
sshd_principals {} AuthorizedPrincipalsFile 的内容
sshd_principals_list_merge 追加 sshd_principalssshd_principals_default 的合并方式。
sshd_config_template sshd_config.j2 /etc/ssh/sshd_config 的默认模板名称
sshd_config_chmod 444 /etc/ssh/sshd_config 的默认权限
sshd_config {} ssh 配置选项
sshd_config_list_merge 追加 sshd_configsshd_default_default 的合并方式。
sshd_config_list_separated_by_comma [] 按逗号分隔的 sshd_config 选项
sshd_config_list_separated_by_newline [] 按行分隔的 sshd_config 选项
sshd_yes_i_know_what_i_am_doing false 跳过检查 AuthorizedPrincipalsFile 的结尾
sshd_config_d_include false 启用 "Include config.d/*"
sshd_banner_template https://raw.githubusercontent.com/claranet/motd/master/banner SSH 横幅模板
可以是一个 URL、本地模板或 null
sshd_banner_template_prepend sshd_banner_template 前添加原始内容
sshd_banner_template_append defaults/main/main.yml sshd_banner_template 后添加原始内容
sshd_banner_template_username sshd_banner_template 是一个 URL 时使用
sshd_banner_template_password sshd_banner_template 是一个 URL 时使用

:arrows_counterclockwise: 依赖

:pencil2: 示例剧本

---
- hosts: all
  vars:
    sshd_trustedusercakeys_content: "{{ lookup('community.hashi_vault.hashi_vault', 'secret=secret/public_key') }}"
    sshd_principals_default:
      admin:
        - adm

  roles:
    - claranet.sshd

自定义 SSHd 配置

sshd_config:
  HostKeyAlgorithms:
    - ssh-dss
    - ssh-rsa

将被记录为 HostKeyAlgorithms ssh-dss,ssh-rsa 在配置文件中。

从默认配置中删除一个密钥

要从默认配置中删除一个密钥,可以将值设置为 null

sshd_config:
  CASignatureAlgorithm: null

:closed_lock_with_key: 加固

:heart_eyes_cat: 贡献

Mozilla 公共许可证版本 2.0

关于项目

Install and configure SSHd. Manages Certificate Authority

安装
ansible-galaxy install claranet.sshd
许可证
mpl-2.0
下载
37.7k
拥有者
Open source projects from and contributed to by Claranet.