{"id":26053411,"url":"https://github.com/jamesworldbuilder/sshkey-manager","last_synced_at":"2026-04-16T16:41:33.488Z","repository":{"id":280924716,"uuid":"943636916","full_name":"jamesworldbuilder/sshkey-manager","owner":"jamesworldbuilder","description":"SSH Key Management Script","archived":false,"fork":false,"pushed_at":"2025-03-21T16:40:19.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T17:35:43.221Z","etag":null,"topics":["bash-script","shell-script","ssh-keys"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamesworldbuilder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-06T03:03:45.000Z","updated_at":"2025-03-21T16:40:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"5961368a-19a5-4f01-ba23-fbac5fa6f646","html_url":"https://github.com/jamesworldbuilder/sshkey-manager","commit_stats":null,"previous_names":["jamesworldbuilder/sshkey-manager"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jamesworldbuilder/sshkey-manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesworldbuilder%2Fsshkey-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesworldbuilder%2Fsshkey-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesworldbuilder%2Fsshkey-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesworldbuilder%2Fsshkey-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesworldbuilder","download_url":"https://codeload.github.com/jamesworldbuilder/sshkey-manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesworldbuilder%2Fsshkey-manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31895647,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T11:36:10.202Z","status":"ssl_error","status_checked_at":"2026-04-16T11:36:09.652Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash-script","shell-script","ssh-keys"],"created_at":"2025-03-08T07:28:23.072Z","updated_at":"2026-04-16T16:41:33.481Z","avatar_url":"https://github.com/jamesworldbuilder.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SSH Key Management Script\n\n## Purpose\nThe `SSH Key Management Script` (`ssh_key_management.sh`) is a Bash utility designed to streamline the process of managing SSH key pairs. It provides a robust solution for validating, copying, and generating SSH keys, ensuring strict permission enforcement and secure handling of files.\n\n## What It Does\nThis script performs the following key functions:\n- **Validates SSH Keys:** Checks the integrity of existing private and public SSH keys in a source directory.\n- **Copies SSH Keys:** Transfers validated keys from a source directory (`SRC_DIR`) to a destination directory (`SSH_DIR`), with options to overwrite or rename files in case of conflicts.\n- **Generates New SSH Keys:** Creates new RSA, ECDSA, or Ed25519 key pairs with user-specified names and adds them to the SSH Agent.\n- **Manages SSH Agent:** Ensures the SSH Agent is running and adds the keys to it for immediate use.\n- **Enforces Security:** Sets appropriate permissions (600 for private keys, 644 for public keys) and warns about unencrypted keys.\n\n## Requirements\nTo work properly, the script requires:\n- **Bash Shell:** Compatible with Bash 4.0 or later.\n- **SSH Tools:** `ssh-keygen` and `ssh-add` must be installed as part of OpenSSH.\n  - **Check if Installed:** Run `ssh-keygen --version` (or `-V` on some systems). If you see a version (e.g., `OpenSSH_8.9p1`), it’s installed. If `command not found`, install it:\n  - **Install OpenSSH:**\n    - **Ubuntu/Debian:** `sudo apt update \u0026\u0026 sudo apt install openssh-client`\n    - **Fedora/RHEL:** `sudo dnf install openssh-clients` (or `yum` for older versions)\n    - **macOS:** Comes pre-installed; update via `brew install openssh` (requires [Homebrew](https://brew.sh/))\n    - **Windows (WSL):** Use Ubuntu/Debian instructions in WSL terminal\n    - **Windows (Native):** Enable via `Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0` in PowerShell, or download from [OpenSSH GitHub](https://github.com/PowerShell/Win32-OpenSSH/releases)\n- **SSH Agent:** An active SSH Agent must be running (start with `eval \"$(ssh-agent -s)\"` if needed).\n- **Configuration File:** A file named `ssh_manager_config.env` in the same directory as the script, containing required environment variables: `SRC_DIR`, `SSH_DIR`, `KEY_COMMENT`, `KEY_TYPE`, `KEY_BITS`.\n- **File System Permissions:** Write access to `SRC_DIR` and `SSH_DIR` (or their parent directories if they need to be created).\n\n## Configuration Variables\nThe script reads its configuration from `ssh_manager_config.env` (which should be located in the same directory as the `ssh_key_management.sh` script file). All variables are mandatory, with no defaults. Below are the required variables:\n\n    SRC_DIR:     Source directory for SSH keys (to copy from or generate into)\n                 Example: /path/to/source_directory/.ssh\n\n    SSH_DIR:     Destination directory for SSH keys (must end with .ssh unless confirmed)\n                 Example: /path/to/ssh_directory/.ssh\n\n    KEY_COMMENT: Comment for generated SSH keys (e.g., an email)\n                 Example: user@example.com\n\n    KEY_TYPE:    Type of SSH key to generate (rsa, ecdsa, or ed25519)\n                 Example: rsa\n\n    KEY_BITS:    Key size in bits (minimum 1024)\n                 Example: 4096\n\n### Example `ssh_manager_config.env`\n```bash\nSRC_DIR=/media/user/source/.ssh\nSSH_DIR=/home/user/.ssh\nKEY_COMMENT=user@example.com\nKEY_TYPE=rsa\nKEY_BITS=4096\n```\n\n## How to Use\n1. **Prepare the Configuration:**\n   - Configuration file should already be included in `sshkey-manager` folder, but if it's not for some reason:\n     - Create `ssh_manager_config.env` in the same directory as the script.\n     - Populate it with the required variables (see above).\n\n2. **Ensure SSH Agent is Running:**\n   - Run `eval \"$(ssh-agent -s)\"` in your terminal if no agent is active.\n\n3. **Make the Script Executable:**\n   ```bash\n   chmod +x ssh_key_management.sh\n   ```\n\n4. **Run the Script:**\n   ```bash\n   ./ssh_key_management.sh\n   ```\n\n5. **Follow Prompts:**\n   - Choose an option (1, 2, or 3) when prompted.\n   - Respond to any conflict resolution or additional prompts as needed.\n\n## Possible Outputs and Inputs\n\n### Successful/Expected Outputs\n\n#### Initial Prompt\n```\n=== SSH Key Management ===\nConfiguration file: '/path/to/ssh_key_management.sh/ssh_manager_config.env'\n  (where environment variables are set)\nSSH Key source directory set to: '/media/user/source/.ssh'\n  (where SSH keys will be copied from or generated in)\nSSH Key destination directory set to: '/home/user/.ssh'\n  (where SSH keys will be copied to)\n\nPlease choose an option:\n  1. \"Copy\" existing SSH keys from '/media/user/source/.ssh'\n  2. \"Generate\" new SSH keys\n  3. \"Cancel\" (or CTRL+C)\n  Enter your choice (1, 2, or 3):\n```\n- **Input:** `1` or `copy`, `2` or `generate`, `3` or `cancel` (case-insensitive). Pressing `CTRL+C` will also cancel.\n- **Empty Input:** Re-prompts with `Invalid choice - Please enter 1, 2, or 3 (CTRL+C to cancel)`.\n\n#### Option 1: Copy Existing Keys (Successful)\n```\n  Enter your choice (1, 2, or 3): 1\nValidating: '/media/user/source/.ssh/id_rsa'\n  Valid private key: '/media/user/source/.ssh/id_rsa'\nValidating: '/media/user/source/.ssh/id_rsa.pub'\n  Valid public key: '/media/user/source/.ssh/id_rsa.pub'\nChecking existence of: '/home/user/.ssh/id_rsa'\n  No conflict detected - Copying...\n  '/media/user/source/.ssh/id_rsa' -\u003e '/home/user/.ssh/id_rsa'\nChecking existence of: '/home/user/.ssh/id_rsa.pub'\n  No conflict detected - Copying...\n  '/media/user/source/.ssh/id_rsa.pub' -\u003e '/home/user/.ssh/id_rsa.pub'\nSet permissions 600 for: id_rsa\nSet permissions 644 for: id_rsa.pub\n[SSH Agent Output...]\n=== Summary ===\nCopied SSH Keys:\n  '/media/user/source/.ssh/id_rsa' ➔ '/home/user/.ssh/id_rsa'\n  '/media/user/source/.ssh/id_rsa.pub' ➔ '/home/user/.ssh/id_rsa.pub'\nSSH-Agent Identities:\n  [displays key fingerprint(s) or \"No keys loaded in agent\"]\n```\n\n#### Option 2: Generate New Keys (Successful)\n```\n  Enter your choice (1, 2, or 3): 2\nEnter new private key name (default: id_rsa) (CTRL+C to cancel): mykey\nGenerating new key pair:\n  '/media/user/source/.ssh/mykey'\n  '/media/user/source/.ssh/mykey.pub'\n  \u003essh-keygen -t rsa -b 4096 -C user@example.com -f /media/user/source/.ssh/mykey\n  **If you provide an empty passphrase, the private key is saved in plaintext (unencrypted)\n  **Entering an empty passphrase is not recommended!\n  **Don't forget your passphrase! A forgotten passphrase cannot be recovered\nEnter passphrase (empty for no passphrase): [user enters passphrase]\n[SSH Agent Output...]\n=== Summary ===\nCopied SSH Keys:\n  '/media/user/source/.ssh/mykey' ➔ '/home/user/.ssh/mykey'\n  '/media/user/source/.ssh/mykey.pub' ➔ '/home/user/.ssh/mykey.pub'\nSSH-Agent Identities:\n  [displays key fingerprint(s)]\n```\n\n#### Option 3: Cancel\n```\n  Enter your choice (1, 2, or 3): 3\nOperation canceled\n\nCleaning temporary resources...\n\nDone\n```\n\n### Error/Warning Outputs:\n\n#### Missing Config File\n```\nERROR: Configuration file (ssh_manager_config.env) not found\n       Expected: '/path/to/ssh_key_management_script/ssh_manager_config.env'\n       Please create it with the required variables\n       Examples:\n         SRC_DIR=/path/to/source_directory/.ssh\n         SSH_DIR=/path/to/ssh_directory/.ssh\n         KEY_COMMENT=email@domain.com\n         KEY_TYPE=rsa\n         KEY_BITS=4096\n```\n\n#### Missing Variable\n```\nERROR: Required variable 'KEY_COMMENT' is not set\n       Configuration file: '/path/to/ssh_key_management_script/ssh_manager_config.env'\n       Examples:\n         SRC_DIR=/path/to/source_directory/.ssh\n         SSH_DIR=/path/to/ssh_directory/.ssh\n         KEY_COMMENT=email@domain.com\n         KEY_TYPE=rsa\n         KEY_BITS=4096\n```\n\n#### Invalid `KEY_BITS`\n```\nERROR: KEY_BITS must be a number greater than or equal to 1024 - Found: '512'\n       Configuration file: '/path/to/ssh_key_management_script/ssh_manager_config.env'\n       Example:\n         KEY_BITS=4096\n```\n\n#### Invalid `KEY_TYPE`\n```\nERROR: KEY_TYPE must be 'rsa', 'ecdsa', or 'ed25519' - Found: 'xyz'\n       Configuration file: '/path/to/ssh_key_management_script/ssh_manager_config.env'\n       Example:\n         KEY_TYPE=rsa\n```\n\n#### Non-existent Source Directory\n```\nERROR: Configured source directory does not exist: '/nonexistent/path'\n       Configuration file: '/path/to/ssh_key_management_script/ssh_manager_config.env'\n       Example:\n         SRC_DIR=/path/to/source_directory/.ssh\n```\n\n#### Non-existent SSH Directory\n```\nERROR: Configured SSH directory does not exist: '/nonexistent/path'\n       Configuration file: '/path/to/ssh_key_management_script/ssh_manager_config.env'\n       Example:\n         SSH_DIR=/path/to/ssh_directory/.ssh\n```\n\n#### Non-standard `SSH_DIR` (e.g., `/home/user/.mykeys`)\n```\nWARNING: SSH_DIR does not end with '.ssh' - Found: '/home/user/.mykeys'\n         This is not a standard SSH directory name\n         This is not recommended!\n         Configuration file: '/path/to/ssh_key_management_script/ssh_manager_config.env'\n         Recommended:\n           SSH_DIR=/path/to/ssh_directory/.ssh\nWould you like to continue anyway? [y/n]:\n```\n- **Input `y` or `yes`:** Proceeds with `/home/user/.mykeys`.\n- **Input `n` or `no`:** `Operation canceled`.\n- **Invalid Input:** `Invalid input - Please enter yes or no (y/n)` (re-prompts).\n\n#### Failed SSH Directory Creation\n```\nERROR: Failed to create SSH_DIR: '/home/user/.ssh'\n```\n\n#### Invalid Choice (Re-prompt)\n```\n  Enter your choice (1, 2, or 3): 4\n  Invalid choice - Please enter 1, 2, or 3\n  Enter your choice (1, 2, or 3):\n```\n\n#### Empty Choice (Re-prompt)\n```\n  Enter your choice (1, 2, or 3): \n  Invalid choice - Please enter 1, 2, or 3 (CTRL+C to cancel)\n  Enter your choice (1, 2, or 3):\n```\n\n#### Pressing [CTRL+C]\n```\n^C\nOperation canceled\n\nCleaning temporary resources...\n\nDone\n```\n\n#### Invalid Key (Re-prompt)\n```\nValidating: '/media/user/source/.ssh/id_rsa'\n  Invalid private key: '/media/user/source/.ssh/id_rsa'\nERROR: Invalid keys detected:\n  '/media/user/source/.ssh/id_rsa'\nGenerate new SSH keys (key pair)? [y/n] (CTRL+C to cancel):\n```\n\n- **Validation Logic** in `validate_ssh_key`\n\n  The `validate_ssh_key()` function checks each file in the `SRC_DIR` directory and categorizes it as a private or public key, determining its validity and encryption status.\n\n  **Private Key Checks**\n    \n    The `validate_ssh_key()` function uses `[[ \"$key_file\" != *.pub ]]` to identify potential private key files, then performs the following checks:\n  - **Empty File:** If the file is empty (`[[ ! -s \"$key_file\" ]]`), it’s invalid (`Invalid: Empty file`).\n  - **Validity and Encryption Status:** The script uses a three-step process with `ssh-keygen` to classify the private key:\n\n      - **1.) Unencrypted Key Test:** The function runs `ssh-keygen -y -P \"\" -f \"$temp_copy\"` to test if the file is a valid unencrypted private key (no passphrase). If this succeeds:\n\n      - **2.) Edge Case Check:** The function runs `ssh-keygen -y -P \"keyisencrypted\"` and `ssh-keygen -y -P \"arewesurekeyisencrypted\"`. If using the \"`keyisencrypted`\" passphrase succeeds but the \"`arewesurekeyisencrypted`\" passphrase fails, the private key is determined to be encrypted with the passphrase \"`keyisencrypted`\" (`Valid encrypted private key with the passphrase \"keyisencrypted\"`). Otherwise, it’s determined to be an unencrypted private key (`Valid private key`). \n\n        This second check addresses the rare, but possible, scenario where a private key is encrypted with an empty passphrase (i.e., \"\"). This edge case creates ambiguity because an encrypted key with an empty passphrase behaves identically to an unencrypted key in the initial test: both will pass `ssh-keygen -y -P \"\"`. Without the additional checks, the script would misclassify such an encrypted key as unencrypted, leading to potential issues later (e.g., in `manage_ssh_agent`).\n\n      - **3.) Encrypted Key Test:** If the empty passphrase test fails, the function runs `ssh-keygen -y -P \"keyisencrypted\"`. If this fails with an \"incorrect passphrase\" error (checked via `grep -q \"incorrect passphrase\"`), the private key is determined to be encrypted with a different passphrase (`Valid encrypted private key`).\n\n  - **Invalid Key:** If each test fails without an \"incorrect passphrase\" error (e.g., due to corruption or invalid format), the private key is determined to be invalid (`Invalid private key`).\n  \n  **Public Key Checks**\n  \n  The `validate_ssh_key()` function uses `[[ \"$key_file\" == *.pub ]]` to check if a file is a possible public key file.\n\n  - **Empty File:** If the file is empty (`[[ ! -s \"$key_file\" ]]`), it's determined to be invalid (`Invalid: Empty file`).\n  - **Not a Valid Public Key:** The script uses `ssh-keygen -l -f \"$key_file\"` to verify if it’s a valid public key. If this fails, the public key is determined to be invalid (`Invalid public key`).\n\n#### Existing File Conflict (e.g., `id_rsa` already in `SSH_DIR`)\n```\nChecking existence of: '/home/user/.ssh/id_rsa'\nConflict detected: 'id_rsa' already exists in '/home/user/.ssh'\nConflict resolution actions for 'id_rsa':\n  1. \"Overwrite\" existing file ('/home/user/.ssh/id_rsa')\n  2. \"Rename\" file to be copied: ('/media/user/source/.ssh/id_rsa')\n  3. \"Cancel\" (or CTRL+C)\n  Choose action for 'id_rsa':\n```\n- **Input `1` or `overwrite`:** Overwrites the existing key file in the `SSH_DIR` directory with the key file being copied from the `SRC_DIR` directory.\n- **Input `2` or `rename`:** Prompts for new filename to rename the key file in the `SRC_DIR` directory before copying it to the `SSH_DIR` directory.\n- **Input `3` or `cancel`:** Cancels operation for that file. Pressing `CTRL+C` will also cancel.\n\n\n#### File Conflict - Empty Key Name (Re-prompt)\n```\nChecking existence of: '/home/user/.ssh/id_rsa'\nConflict detected: 'id_rsa' already exists in '/home/user/.ssh'\nConflict resolution actions for 'id_rsa':\n  1. \"Overwrite\" existing file ('/home/user/.ssh/id_rsa')\n  2. \"Rename\" file to be copied: ('/media/user/source/.ssh/id_rsa')\n  3. \"Cancel\" (or CTRL+C)\n  Choose action for 'id_rsa': 2\n  Enter new filename (CTRL+C to cancel): \nERROR: Filename cannot be empty\n  Enter new filename (CTRL+C to cancel):\n```\n- Re-prompts until a non-empty name is provided.\n\n#### Key Name with Forward Slashes (Re-Prompt)\n```\n  Enter new filename (default: id_rsa) (CTRL+C to cancel): my/key\nERROR: Filename cannot contain forward-slashes\n  Enter new filename (default: id_rsa) (CTRL+C to cancel):\n```\n- Re-prompts until a name without `/` is provided.\n\n#### Key Name Exceeds Character Limit (255 bytes) (Re-prompt)\n```\n  Enter new filename (default: id_rsa) (CTRL+C to cancel): ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\nERROR: Exceeded character limit (max 255 bytes)\n  Enter new filename (default: id_rsa) (CTRL+C to cancel):\n```\n- Re-prompts until a name ≤ 255 bytes is provided.\n\n#### Key Name with Disallowed Characters (Re-prompt)\n```\n  Enter new filename (default: id_rsa) (CTRL+C to cancel): my@key!\nERROR: Disallowed characters in filename\n       Allowed characters: letters, numbers, dots, underscores, hyphens\n  Enter new filename (default: id_rsa) (CTRL+C to cancel):\n```\n- Re-prompts until a name with only `[A-Za-z0-9._-]` is provided.\n\n#### Private Key Name Ending with `.pub` (Re-prompt)\n```\n  Enter new private key name (default: id_rsa) (CTRL+C to cancel): mykey.pub\nERROR: Not a public key - Filename must not end with '.pub'\n  Enter new private key name (default: id_rsa) (CTRL+C to cancel):\n```\n- Re-prompts until a private key name not ending in `.pub` is provided (only thrown for private key filenames).\n\n#### Public Key Name Not Ending with `.pub` (Re-prompt)\n```\n  Enter new filename (default: id_rsa) (CTRL+C to cancel): mykey\nERROR: Requires '.pub' extension for public key\n  Enter new filename (default: id_rsa) (CTRL+C to cancel):\n```\n- Re-prompts until a public key name ending in `.pub` is provided (only thrown for public key filenames).\n\n#### Key Name Already Exists (Re-prompt)\n```\n  Enter new private key name (default: id_rsa) (CTRL+C to cancel): id_rsa\nERROR: Filename already exists in '/media/user/source/.ssh'.\n  Enter new private key name (default: id_rsa) (CTRL+C to cancel):\n```\n- Re-prompts until a unique name is provided (checks existing filenames in `SRC_DIR`).\n\n#### Key Generation Failure (e.g., insufficient permissions or disk space)\n```\nEnter new private key name (default: id_rsa) (CTRL+C to cancel): mykey\nGenerating new key pair:\n  '/media/user/source/.ssh/mykey'\n  '/media/user/source/.ssh/mykey.pub'\n  \u003essh-keygen -t rsa -b 4096 -C user@example.com -f /media/user/source/.ssh/mykey\n  **If you provide an empty passphrase, the private key is saved in plaintext (unencrypted)\n  **Entering an empty passphrase is not recommended!\n  **Don't forget your passphrase! A forgotten passphrase cannot be recovered\nERROR: Key generation failed\n```\n- Thrown if `ssh-keygen` fails (e.g., due to no write permission).\n\n#### SSH Agent Not Running\n```\nERROR: SSH Agent is not running or not accessible\n       To start an SSH Agent manually, run the following command in your terminal:\n         eval \"$(ssh-agent -s)\"\n       Then re-run this script\nCurrent environment:\n  SSH_AUTH_SOCK: not set\n  SSH_AGENT_PID: not set\n```\n- #### SSH Agent Status Check \n  The script includes a helper function, `ssh_agent_running()`, to verify that an SSH Agent is active and operational before attempting to add keys. This function checks:\n\n    - ##### Agent Environment: \n      It confirms that the `SSH_AUTH_SOCK` environment variable is set (indicating an agent is running) and points to a valid socket file (a special file used for communication with the agent).\n    - ##### Agent Responsiveness: \n      It tests if the agent can list loaded keys using `ssh-add -l`. If this command succeeds (no keys or some keys listed) or fails with a specific \"no identities\" error, the agent is considered running. If the socket is invalid or the agent doesn’t respond, it’s deemed not running.\n    - ##### Outcome: \n      Returns `0` (success) if the agent is running and responsive, or `1` (failure) if the agent is not running, allowing the script to proceed or exit with an error message accordingly.\n\n---\n## Author Details\n- **Name:** James Logan Forsyth\n- **Email:** james3895@duck.com\n- **Date Created:** March 2025\n- **License:** MIT License\n\n      Copyright (c) 2025 - James Logan Forsyth\n      \n      Permission is hereby granted, free of charge, to any person obtaining a copy\n      of this software and associated documentation files (the \"Software\"), to deal\n      in the Software without restriction, including without limitation the rights\n      to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n      copies of the Software, and to permit persons to whom the Software is\n      furnished to do so, subject to the following conditions:\n\n      The above copyright notice and this permission notice shall be included in all\n      copies or substantial portions of the Software.\n\n      THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n      IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n      FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n      AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n      LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n      OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n      THE SOFTWARE.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesworldbuilder%2Fsshkey-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesworldbuilder%2Fsshkey-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesworldbuilder%2Fsshkey-manager/lists"}