{"id":31626393,"url":"https://github.com/sewertronics/ssh-copy-id","last_synced_at":"2025-10-15T05:42:10.613Z","repository":{"id":314866705,"uuid":"1055594256","full_name":"Sewertronics/ssh-copy-id","owner":"Sewertronics","description":"🔑 PowerShell script to safely add SSH public keys from your local ssh-agent to remote servers, preserving comments and appending your Windows username.","archived":false,"fork":false,"pushed_at":"2025-09-25T13:32:31.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-25T15:33:16.080Z","etag":null,"topics":["automation","cross-platform","devops","linux","powershell","script","server-management","ssh","ssh-agent","windows","wsl"],"latest_commit_sha":null,"homepage":"http://www.sewertronics.com","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sewertronics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-12T13:55:04.000Z","updated_at":"2025-09-25T13:32:21.000Z","dependencies_parsed_at":"2025-09-15T10:23:18.679Z","dependency_job_id":"78846042-4168-4650-a4d6-09fb88f5112a","html_url":"https://github.com/Sewertronics/ssh-copy-id","commit_stats":null,"previous_names":["sewertronics/ssh-copy-id"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Sewertronics/ssh-copy-id","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sewertronics%2Fssh-copy-id","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sewertronics%2Fssh-copy-id/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sewertronics%2Fssh-copy-id/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sewertronics%2Fssh-copy-id/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sewertronics","download_url":"https://codeload.github.com/Sewertronics/ssh-copy-id/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sewertronics%2Fssh-copy-id/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278671749,"owners_count":26025743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["automation","cross-platform","devops","linux","powershell","script","server-management","ssh","ssh-agent","windows","wsl"],"created_at":"2025-10-06T19:51:45.322Z","updated_at":"2025-10-06T19:51:46.456Z","avatar_url":"https://github.com/Sewertronics.png","language":"PowerShell","readme":"# 🔑 Add SSH Key to Remote Server\n\n[![PowerShell](https://img.shields.io/badge/language-PowerShell-blue?logo=powershell)](https://docs.microsoft.com/powershell/)\n[![Platform](https://img.shields.io/badge/platform-Windows-lightgrey?logo=windows)](https://www.microsoft.com/windows/)\n[![SSH](https://img.shields.io/badge/SSH-Enabled-green?logo=ssh)](https://www.openssh.com/)\n[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)\n[![Script](https://img.shields.io/badge/type-script-yellow)](add-sshkey.ps1)\n\nThis PowerShell script adds an SSH public key from your local `ssh-agent` to a remote server's `authorized_keys` file. It preserves the key’s original comment and appends your Windows username for identification. The script ensures the `.ssh` directory and `authorized_keys` file exist, sets correct permissions, and can optionally use password authentication.\n\n## 🌟 Features\n\n- ✅ Appends public key **only once** to avoid duplicates\n- 📝 Preserves original key comment and appends your Windows username\n- 🛠 Works even if `.ssh` or `authorized_keys` does not exist\n- 🔐 Can force **password authentication** to avoid `Too many authentication failures`\n- ⚡ Simple usage on Windows PowerShell\n- 🧩 Safe with multiple keys in your SSH agent\n- 📌 Keeps permissions secure for `.ssh` and `authorized_keys`\n\n## 📋 Requirements\n\n- 🖥 Windows PowerShell (5.1+) or PowerShell 7+\n- 🔧 SSH installed (`ssh` command available)\n- 🗝 Optional: SSH agent running with keys loaded (e.g., via Bitwarden)\n- 🌐 Remote server accessible over SSH\n- 🔑 Ensure your SSH key is added to the **Bitwarden SSH agent** (it has to be enabled - [Settings -\u003e Enable SSH agent](https://bitwarden.com/help/ssh-agent/#enable-ssh-agent))\n  \u003cbr /\u003e\u003cspan style=\"color: orange\"\u003e👉 **Important**: The key’s name must include the server identifier (e.g., `ubuntu@10.74.90.100`)\u003c/span\u003e\n\n## 🚀 Usage in Windows (PowerShell)\n\n```powershell\n# Basic usage\ngit clone git@github.com:Sewertronics/ssh-copy-id.git\ncd ssh-copy-id\n.\\ssh-copy-id.ps1 ubuntu@10.74.90.100\n```\n\n## ©️ Copyright\n\n\u003cimg src=\"https://sewertronics.com/wp-content/uploads/2024/06/sewertronics-logo-CMYK-black.png.webp\" alt=\"Docker Logo\" width=\"200\" align=\"right\"\u003e\n© 2025 Sewertronics Sp z o.o.\n\nThis project is licensed under the [MIT License](LICENSE).\n\nAll rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted under the terms of the MIT License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsewertronics%2Fssh-copy-id","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsewertronics%2Fssh-copy-id","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsewertronics%2Fssh-copy-id/lists"}