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 Distribution

sshkey_switch-0.2.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

sshkey_switch-0.2.0-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file sshkey_switch-0.2.0.tar.gz.

File metadata

  • Download URL: sshkey_switch-0.2.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for sshkey_switch-0.2.0.tar.gz
Algorithm Hash digest
SHA256 76cc1dc846da70a28c9ad494daaaf717fa40a019854bede17ec214160833c1ee
MD5 d359f29a026e774da224053ffeead638
BLAKE2b-256 6d3b6ace80f3e70a8b5b3061ea9c1979812bda3177335397fb4e2f689467777d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sshkey_switch-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.3 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6bbe3e8326faab11824ffd359e1c2518c540ca688476da4cb26c6b0161cd4f64
MD5 67bd7f902c30c25a6fe507f9be9ab15f
BLAKE2b-256 335f0e7401f5470c75d72fc9a249d901d01a1b219975065bba4f7d7044ed9215

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