From caaa3e31eb38c112c9c116086512275bc1a7db42 Mon Sep 17 00:00:00 2001 From: Yanbing Date: Fri, 2 Jun 2017 19:39:04 -0700 Subject: [PATCH] Updated OpenSSH utility scripts to fix file permissions (markdown) --- OpenSSH-utility-scripts-to-fix-file-permissions.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/OpenSSH-utility-scripts-to-fix-file-permissions.md b/OpenSSH-utility-scripts-to-fix-file-permissions.md index a82ddc4..0e1b9ea 100644 --- a/OpenSSH-utility-scripts-to-fix-file-permissions.md +++ b/OpenSSH-utility-scripts-to-fix-file-permissions.md @@ -1,6 +1,6 @@ Powershell utility scripts are included starting release [V0.0.15.0](https://github.com/PowerShell/Win32-OpenSSH/releases/tag/v0.0.15.0) to automatically fix the permissions on various keys and configuration files for host and user. [Secure protection of various files](https://github.com/PowerShell/Win32-OpenSSH/wiki/Security-protection-of-various-files-in-Win32-OpenSSH) explains why secure enforcement is needed. - `FixHostFilePermissions.ps1`: checks and fixes the below permissions on default host files: - - user's authorized_keys located at ```$env:systemdrive\Users\...\.ssh\authorized_keys``` + - user's authorized_keys located at `$env:systemdrive\Users\...\.ssh\authorized_keys` - host keys generated by `ssh-keygen.exe -A` in the same folder of the script - sshd_config in the same folder of the script @@ -9,9 +9,9 @@ Powershell utility scripts are included starting release [V0.0.15.0](https://git .\FixHostFilePermissions.ps1 ``` - `FixUserFilePermissions.ps1`: checks and fixes the below file permissions for user's default files: - - user's ssh_config located at ~\.ssh\config - - user's keys located at ~\.ssh\id_rsa, id_rsa.pub - - user's keys located at ~\.ssh\id_dsa, id_dsa.pub + - user's ssh_config located at `~\.ssh\config` + - user's keys located at `~\.ssh\id_rsa`, `~\.ssh\id_rsa.pub` + - user's keys located at `~\.ssh\id_dsa`, `~\.ssh\id_dsa.pub` ```PowerShell # -Quiet suppresses prompting to confirm you want to update each permission @@ -29,8 +29,8 @@ Import-Module .\OpenSSHUtils.psm1 -Force # prompt to confirm you want to confirm you want to update each permission on the file Fix-HostSSHDConfigPermissions c:\test\sshd_config # -Quiet suppresses prompting to confirm you want to update each permission on the file -Fix-HostKeyPermissions -FilePath c:\test\sshtest_userssokey_ed25519 -Quiet +Fix-HostKeyPermissions -FilePath c:\test\sshtest_hostkey_ecdsa -Quiet Fix-AuthorizedKeyPermissions -FilePath C:\Users\sshtest_ssouser\.ssh\authorized_keys -Quiet -Fix-HostUserPermissions -FilePath c:\test\sshtest_hostkey_ecdsa -Quiet -Fix-UserSSHConfigPermissions -FilePath ~\.ssh\config -Quiet +Fix-HostUserPermissions -FilePath c:\test\sshtest_userssokey_ed25519 -Quiet +Fix-UserSSHConfigPermissions -FilePath '~\.ssh\config' -Quiet ``` \ No newline at end of file