Giter VIP home page Giter VIP logo

ops345's Introduction

AWS EC2 Initial Setup Script

This script is designed to facilitate the initial setup of a newly instantiated AWS EC2 instance. It allows for a secure and swift transition from the default EC2 user setup by automating several setup tasks.

Features:

  • User and Hostname Setup: Prompts for and sets up a new username and a desired hostname.
  • SSH Key Configuration: Dynamically determines the current logged-in user to copy SSH key configurations to the new user.
  • Sudo Permissions: Creates a new user and grants it sudo permissions without needing a password.
  • Hostname Configuration: Allows setting up a custom hostname for the instance.
  • Preserve Hostname Modification: Modifies /etc/cloud/cloud.cfg to set preserve_hostname.

Usage:

  1. Clone this Repository:
    git clone https://github.com/HezhaKh/ops345.git
  2. Navigate to the Script Directory:
    cd /path/to/script/directory/
  3. Make the Script Executable:
    chmod +x setup_aws.sh
  4. Execute the Script with Sudo:
    sudo ./setup_aws.sh
  5. Follow On-Screen Prompts:
    • Enter the desired username.
    • Enter the desired hostname.
    • Follow any additional prompts to complete the setup.

Purpose:

This script is purposed to:

  • Verify root/sudo privileges.
  • Gather inputs for new username, hostname, and sudoers filename.
  • Set up a new user with sudo privileges without a password and with the correct permissions.
  • Copy SSH key configurations from the current user to the new user.
  • Apply the new hostname.
  • Modify preserve_hostname in /etc/cloud/cloud.cfg.
  • Provide a completion message with further instructions or actions.

Final Note:

Make sure to test the new user setup and configurations after the completion of the script and adjust as necessary.

ops345's People

Contributors

hezhakh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.