https://github.com/willfarrell/ansible-role-sshd
Setup user accounts on CentOS
https://github.com/willfarrell/ansible-role-sshd
Last synced: 26 days ago
JSON representation
Setup user accounts on CentOS
- Host: GitHub
- URL: https://github.com/willfarrell/ansible-role-sshd
- Owner: willfarrell
- Created: 2017-03-23T02:03:38.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-08T05:22:42.000Z (almost 9 years ago)
- Last Synced: 2025-09-18T13:57:35.968Z (6 months ago)
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ansible-role-sshd
## Requirements
- `ansible` >= 2.3
- `python-passlib`
## Install
Add to `requirements.yml`.
```
- name: galaxy.sshd
src: https://github.com/willfarrell/ansible-role-sshd.git
```
Install Requirements:
`ansible-galaxy install --roles-path=./roles -r requirements.yml`
### authorized_keys
1. Create folder `authorized_keys` at root of playbook.
1. Create files for each user you plan to use inside `authorized_keys`, using `username` as the file name and their public keys as the file contents.
1. Copy folder into role before running. `cp -r authorized_keys roles/galaxy.sshd/files/`
## Setup
Change the default password for users
```bash
pip install passlib
python -c "from passlib.hash import sha512_crypt; import getpass; print sha512_crypt.using(rounds=5000).hash(getpass.getpass())"
# Enter password
# Use value to set: `ssh_default_password`
```
## TODO
- [ ] BUG add user needs to be run twice ... ?