Skip to content

KB-iGOT/igot-gcp-server-access

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Server Access and User Management

Prod Env User Update UAT Env User Update QA Env User Update Dev Env User Update

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.

Table of Contents

Prerequisites

  • Linux environment (for generating password and SSH key)
  • GitHub account
  • Git installed on your local machine

How to Generate a Password

  1. Open your terminal.
  2. Run the following command to install mkpasswd if it is not already installed:
    sudo apt-get install whois
  3. Generate a password hash using the mkpasswd command:
    mkpasswd --method=sha-512
  4. You will be prompted to enter your desired password. Once entered, the command will output an encrypted password string.

How to Generate an SSH Key

  1. Open your terminal.
  2. Run the following command to generate a new SSH key:
    ssh-keygen -t rsa -b 4096 -C "[email protected]"
  3. Follow the prompts to save the key to the default location (usually ~/.ssh/id_rsa) and enter a passphrase if desired.
  4. After generating the key, you can display the public key with:
    cat ~/.ssh/id_rsa.pub
  5. Copy the output, which will look something like this:
    ssh-rsa AAAAB3... rest_of_your_key ... [email protected]
    

Updating the users/dev.yml File

  1. Fork this repository to your own GitHub account.
  2. Clone your fork to your local machine:
    git clone https://github.com/KB-iGOT/igot-gcp-server-access.git
  3. Navigate to the repository directory:
    cd igot-gcp-server-access
  4. Open the users/dev.yml file in a text editor.
  5. 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]"

Creating a Pull Request

  1. Commit your changes:
    git add users/dev.yml
    git commit -m "Add/Update user 'username'"
  2. Push your changes to your fork:
    git push origin main
  3. Go to the original repository on GitHub and create a pull request from your fork.

Reviewing and Merging

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages