Skip to content

devidence-dev/ssh-github-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ GitHub SSH Key Setup Script

Welcome! This project provides an interactive Bash script to help you generate and configure SSH keys for use with GitHub. It guides you step-by-step to create a secure SSH key, add it to your GitHub account, and configure your SSH client for seamless authentication.


✨ Features

  • 🎨 Interactive prompts with color and emoji for a friendly user experience
  • πŸ“§ Email validation to ensure correct input
  • πŸ”‘ Choice of key type: modern (ed25519) or legacy (RSA)
  • πŸ“ Customizable key file name and location
  • ⚑ Automatic SSH key generation and addition to the ssh-agent
  • πŸ‘€ Displays your public key and provides clear instructions for adding it to GitHub
  • πŸ€– Optional automatic upload of your public key to GitHub using a personal access token
  • πŸ› οΈ Updates your ~/.ssh/config for GitHub usage
  • πŸ”— Tests your SSH connection to GitHub

πŸ› οΈ Requirements

  • 🐧 Bash shell (tested on macOS and Linux)
  • πŸ” ssh-keygen and ssh-agent utilities
  • 🌐 curl (for optional automatic upload)

🚦 Usage

  1. Clone or download this repository.
  2. Run the script:
    bash setup-ssh-keys.sh
  3. Follow the interactive prompts:
    • πŸ“§ Enter your GitHub email address (validated for correct format)
    • πŸ”‘ Choose the SSH key type (ed25519 recommended)
    • πŸ“ Optionally specify a custom file name for your key
    • ⚑ The script will generate your SSH key and add it to the ssh-agent
    • πŸ‘€ Your public key will be displayed for you to copy
    • πŸ€– Optionally, you can upload the key automatically to GitHub by providing your username and a personal access token with admin:public_key scope
    • πŸ› οΈ The script will update your SSH config and test the connection to GitHub

πŸ”’ Security Notice

  • 🚫 Never share your private key. Only the public key (.pub file) should be uploaded or shared.
  • πŸ›‘οΈ If you use the automatic upload feature, your GitHub personal access token is only used locally and not stored.

Authors and acknowledgment πŸ›‘

Pablo Pin - devidence.dev Β©

License πŸ”’

Pablo Pin - devidence.dev Β©

About

Interactive Bash script to easily generate, configure, and upload SSH keys for GitHub, with color prompts, emoji, and email validation.

Topics

Resources

Stars

Watchers

Forks

Languages