https://github.com/francomile/ansible-role-ssh
Ansible Role SSH
https://github.com/francomile/ansible-role-ssh
ansible-role security ssh
Last synced: 5 months ago
JSON representation
Ansible Role SSH
- Host: GitHub
- URL: https://github.com/francomile/ansible-role-ssh
- Owner: francomile
- License: gpl-2.0
- Created: 2024-06-15T22:35:50.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-16T23:41:31.000Z (about 2 years ago)
- Last Synced: 2025-07-17T12:15:14.768Z (12 months ago)
- Topics: ansible-role, security, ssh
- Language: Jinja
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Ansible SSH Role
[](https://github.com/francomile/ansible-role-ssh/actions/workflows/ansible_lint.yml)
[](https://github.com/francomile/ansible-role-ssh/actions/workflows/push_to_galaxy.yml)
## Actions of the Role
* Setup SSH and enforce security
## Common Usage
```yaml
roles:
- { role: francomile.ssh,
ssh_port: 22,
ssh_authorized_keys_file: false,
ssh_permit_root_login: "no",
ssh_password_authentication: "no",
ssh_pubkey_authentication: "yes",
ssh_use_pam: "yes",
# If you want to set allowed users and groups, set first ro true the switches and define the users and groups:
# ssh_allow_users: true,
# ssh_allow_users_list: ["johndoe", "batman"],
# ssh_allow_groups: true,
# ssh_allow_groups_list: ["adm", "sudo"],
tags: ["ssh"]
}
```
## Run the playbook
```shell
ansible-playbook -i inventory playbook.yaml --tags "ssh"
```