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.3.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sshkey_switch-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 252191260f4f59ca96f5160c18a7b57f1e0a76ec4133388c673b7b4bd535e0c0
MD5 3848445fb57cd7fe69da9de8a251cd3e
BLAKE2b-256 951d2cdcc2795a0978dafd7499193f5a9a70f9a26a3680e829d7542817b9fa2f

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