Skip to main content

A command-line tool for switching SSH keys

Project description

sshkey-switch

Overview

sshkey-switch is a command-line utility that allows users to easily switch between multiple SSH keys in the same terminal. It automates the process of managing SSH keys by listing available keys, selecting one interactively, and adding it to the ssh-agent.

Supported Operating System

  • Mac Os
  • Linux

Features

  • Lists all valid SSH private keys from ~/.ssh/
  • Allows interactive selection of an SSH key
  • Automatically starts ssh-agent if not running
  • Removes previously added SSH keys before adding the new one
  • Stores recently used keys for quick selection
  • Provides instructions to activate the environment variables

Installation

# pip install sshkey-switch

Usage

# sshkey-switch

Follow the on-screen instructions to select an SSH key.

Example Output

# sshkey-switch
? Select SSH private key: (Use arrow keys)
 » deploy1 *recent
   github_repo1
   id_rsa
   gitlab_repo2
✅ SSH key switched to: ~/.ssh/github_key
✅ ssh-agent is working correctly.

Notes

  • Ensure you run source ~/.bashrc if prompted to activate environment variables.
  • The script only lists valid SSH private keys and excludes public keys or other files.

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sshkey_switch-0.4.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file sshkey_switch-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: sshkey_switch-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for sshkey_switch-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29a38f95ed4d4b2c85ac54a5f6b3fba28ab962bcc634482c9e8f9b5cda045339
MD5 3fc59716f8a00d64c5f7840349d5a8ea
BLAKE2b-256 0eea55f8f94afac381e8c055b41acdb31629b87f7c118ff74c3bf530b676dab6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page