Skip to content

OpenSSH utility scripts to fix file permissions

Yanbing edited this page Jun 3, 2017 · 20 revisions

Powershell utility scripts are included starting release V0.0.15.0 to help you fix the file permissions.

  • FixHostFilePermissions.ps1: check and fix the file permission for default config files on host:
    • 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
  • FixUserFilePermissions.ps1: check and fix the file permission 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
  • Powershell module OpenSSHUtils.psm1 helps to check and fix customer specified files.
    • Function Fix-HostSSHDConfigPermissions fix the sshd_config file specified by user
    • Function Fix-HostKeyPermissions fix the permission for host keys specified by user
    • Function Fix-UserKeyPermissions fix the the permissions for user's key files specified by user
    • Function Fix-AuthorizedKeyPermissions fix the permissions for the authorized_keys file specified by user
    • Function Fix-UserSSHConfigPermissions fix the permissions for user's ssh config specified by user
Clone this wiki locally