This repository is used to manage users for Linux remote servers. Users can request the creation of new accounts or update existing ones by creating pull requests with the necessary details in the users/team.yml
file.
- Prerequisites
- How to Generate a Password
- How to Generate an SSH Key
- Updating the
users/team.yml
File - Creating a Pull Request
- Linux environment (for generating password and SSH key)
- GitHub account
- Git installed on your local machine
- Open your terminal.
- Run the following command to install
mkpasswd
if it is not already installed:sudo apt-get install whois
- Generate a password hash using the
mkpasswd
command:mkpasswd --method=sha-512
- You will be prompted to enter your desired password. Once entered, the command will output an encrypted password string.
- Open your terminal.
- Run the following command to generate a new SSH key:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
- Follow the prompts to save the key to the default location (usually
~/.ssh/id_rsa
) and enter a passphrase if desired. - After generating the key, you can display the public key with:
cat ~/.ssh/id_rsa.pub
- Copy the output, which will look something like this:
ssh-rsa AAAAB3... rest_of_your_key ... your_email@example.com
- Fork this repository to your own GitHub account.
- Clone your fork to your local machine:
git clone https://github.com/srajasimman/ansible-role-users.git
- Navigate to the repository directory:
cd ansible-role-users
- Open the
users/team.yml
file in a text editor. - Add or update a user entry with your details:
users: username: # your username state: present password: "$6$/BprRrv6N2" # replace with your generated password hash ssh_public_key: "ssh-rsa AAAAB...your_key... your_email@example.com"
- Commit your changes:
git add users/team.yml git commit -m "Add/Update user 'username'"
- Push your changes to your fork:
git push origin main
- Go to the original repository on GitHub and create a pull request from your fork.
Your pull request will be reviewed by a repository maintainer. Once approved, your changes will be merged, and the new user configuration will be applied to the Linux remote servers.
Thank you for contributing to the Linux Remote Server User Management project!