compute-connect is a streamlined Bash script (start.sh) designed to simplify the process of managing SSH connections to Google Cloud Platform (GCP) compute instances. The script allows users to easily select a project, list active compute instances, and connect to a desired instance with minimal effort.
- Lists available GCP projects from a configuration file (
projects.config). - Enables selection of a project to set as the active project.
- Displays all active compute instances with numbering for easy selection.
- Facilitates SSH connections to the selected compute instance.
- Google Cloud SDK installed and configured on your local machine.
- Access to a GCP project with compute instances.
- A
projects.configfile containing a list of project IDs.
- Clone this repository:
git clone https://github.com/webdevtodayjason/compute-connect.git cd compute-connect - Ensure
start.shhas executable permissions:chmod +x start.sh
- Create a
projects.configfile in the same directory and add your project IDs, one per line:another-project-id another-project-id2 another-project-id65 another-project-id23
Run the script using:
./start.sh- Project Selection: The script reads the
projects.configfile and displays a numbered list of projects. - Instance Listing: Lists all active instances in the selected project, with numbering for easy reference.
- SSH Connection: Prompts the user to select an instance by number and connects via SSH.
- Ensure you have the necessary permissions to access the specified GCP projects and instances.
- Update the
projects.configfile as needed to add or remove project IDs.
This project is licensed under the MIT License. See the LICENSE file for details.
Pull requests are welcome. For significant changes, please open an issue first to discuss what you would like to change.
Created by Jason.
- Google Cloud Platform documentation
- Bash Scripting Guide