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/dev.yml
file.
- Prerequisites
- How to Generate a Password
- How to Generate an SSH Key
- Updating the
users/dev.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 "[email protected]"
- 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 ... [email protected]
- Fork this repository to your own GitHub account.
- Clone your fork to your local machine:
git clone https://github.com/KB-iGOT/igot-gcp-server-access.git
- Navigate to the repository directory:
cd igot-gcp-server-access
- Open the
users/dev.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... [email protected]"
- Commit your changes:
git add users/dev.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.