{"id":14064447,"url":"https://github.com/countzero/repair_ssh_permissions","last_synced_at":"2026-04-26T23:03:51.614Z","repository":{"id":136211533,"uuid":"348096618","full_name":"countzero/repair_ssh_permissions","owner":"countzero","description":"A PowerShell script that automatically repairs the permissions of the .ssh directory and files.","archived":false,"fork":false,"pushed_at":"2024-02-12T07:39:50.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-14T07:06:54.909Z","etag":null,"topics":["openssh","powershell","repair-ssh-permissions","ssh","windows"],"latest_commit_sha":null,"homepage":"","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/countzero.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}},"created_at":"2021-03-15T19:24:35.000Z","updated_at":"2024-02-12T07:39:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"3a8687da-c549-4ba2-88c7-31c661837fb0","html_url":"https://github.com/countzero/repair_ssh_permissions","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/countzero%2Frepair_ssh_permissions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/countzero%2Frepair_ssh_permissions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/countzero%2Frepair_ssh_permissions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/countzero%2Frepair_ssh_permissions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/countzero","download_url":"https://codeload.github.com/countzero/repair_ssh_permissions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228040596,"owners_count":17860211,"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","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":["openssh","powershell","repair-ssh-permissions","ssh","windows"],"created_at":"2024-08-13T07:03:52.255Z","updated_at":"2026-04-26T23:03:51.575Z","avatar_url":"https://github.com/countzero.png","language":"PowerShell","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"readme":"# Repair the permissions of the .ssh directory and files\nThe best practice configuration for the personal .ssh directory is to restrict all access to the corresponding local user. This will be enforced by [OpenSSH](https://www.openssh.com/) and any misconfiguration will result in OpenSSH ignoring the .ssh directory contents with a warning.\n\nThis PowerShell script automatically repairs the permissions of the `.ssh` directory and files. It does the following for all items within and including the given `.ssh` directory:\n\n* Disables inheritance\n* Sets ownership to one user\n* Removes all permissions\n* Grants one user full control\n\n## Installation\nDownload and unpack the [latest release](https://github.com/countzero/repair_ssh_permissions/releases/latest) to your machine.\n\n## Usage\nOpen a PowerShell console at the location of the unpacked release and execute the [./repair_ssh_permissions.ps1](https://github.com/countzero/repair_ssh_permissions/blob/main/repair_ssh_permissions.ps1).\n\n**Hint:** If you are running into an `SeSecurityPrivilege` error execute the command with administrator privileges.\n\n## Examples\n\n### Repair the current users default .ssh directory\nExecute the following command to repair the '%USERPROFILE%/.ssh' directory (and all items within) for the current Windows user.\n\n```PowerShell\n.\\repair_ssh_permissions.ps1\n```\n\n\u003e [!NOTE]\n\u003e The script will automatically elevate itself to administrator privileges.\n\n### Repair a specific .ssh directory for a specific user\nExecute the following command with to repair a specific directory for a specific local Windows user.\n\n```PowerShell\n.\\repair_ssh_permissions.ps1 -path \"X:\\unsual\\path\\to\\.ssh\" -user \"John Doe\"\n```\n\n### Get detailed help\nExecute the following command to get detailed help.\n\n```PowerShell\nGet-Help .\\repair_ssh_permissions.ps1 -detailed\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcountzero%2Frepair_ssh_permissions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcountzero%2Frepair_ssh_permissions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcountzero%2Frepair_ssh_permissions/lists"}