/EC2-auto-logger

This is a script that automates my daily workflow of logging in to my remote aws EC2 instance with a .pem file

Primary LanguageShellMIT LicenseMIT

EC2-auto-logger

2024-02-01.20-29-57.mp4

📗 Table of Contents

📖 EC2 Auto Logger

EC2 Auto Logger is a script that improves my productiviy i.e. it automates my daily workflow of logging in to my AWS EC2 instance remotely with a .pem file maintaining a clean and organized file/folder structure rather than a clutter of .pem files in my DOwnloads folder that I struggle to look through to figure out which was most recently downloaded.

🛠 Built With

Tech Stack

Bash

Key Features

  • Locate .pem file
  • Initiate login to instance

(back to top)

🚀 Live Demo

Live demo for functioning script.

(back to top)

💻 Getting Started

To get a local copy up and running, follow these steps.

Setup

  1. create a ~/AWS_SSL folder to manage all your ssh keys for logins to your instances

  2. Create a filename.sh file and copy the contents of move_and_ssh.sh into it on your preferred location

  3. Give the .sh file execute permissions with:

  chmod +x filename.sh

  1. Create an alias in your /.bashrc file to use when running the script in this case loginaws
  alias loginaws='move_and_ssh.sh'

  1. Close file and reload shell configuration with
    source ~/.bashrc 

(back to top)

Usage

  • Download your allocated .pem file from labs.

  • Run the command loginaws from terminal

  • Enter IPV4 Address of your remote EC2 instance.

  • Congratulations !!! Logged in successfully with a few clicks

(back to top)

Edge Cases

  • The script checks for downloads of labsuser.pem file, If you have a .pem file with different naming, adjust the variable in the script.

  • The location of the .pem file keys downloaded are presumed to be in the downloads folder.

(back to top)

👥 Authors

👤 Abel Morara

(back to top)

🔭 Future Features

  • [Handle remote Login to multiple instances]

(back to top)

🤝 Contributing

Contributions, issues, as well as feature requests are welcome! Fork the Repo and make some magic.

Feel free to check the issues page.

(back to top)

⭐️ Show your support

If you like this script, kindly leave a comment below and share it with someone who enjoys coding! or still, give it a ⭐️!

(back to top)

📝 License

This project is MIT licensed.

(back to top)