X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=ssh-utils%2Fssh-pubkey.ps1;h=e323496072163c09f2d9f547867fb3c638048fb6;hb=59074b5d9d0a9f03a0f525011a3cbd37428347c4;hp=3af6a590af3ffe7d67fb8187393574dc3b00405b;hpb=e6bc2294790481611742c0ae8c26f7760e6c5b8d;p=webi-installers%2F.git diff --git a/ssh-utils/ssh-pubkey.ps1 b/ssh-utils/ssh-pubkey.ps1 index 3af6a59..e323496 100644 --- a/ssh-utils/ssh-pubkey.ps1 +++ b/ssh-utils/ssh-pubkey.ps1 @@ -5,28 +5,28 @@ if (!(Test-Path -Path "$Env:USERPROFILE/.ssh")) { - New-Item -Path "$Env:USERPROFILE/.ssh" -ItemType Directory - & icacls "$Env:USERPROFILE/.ssh" /inheritance:r - & icacls "$Env:USERPROFILE/.ssh" /grant:r "%username%":"(F)" + New-Item -Path "$Env:USERPROFILE/.ssh" -ItemType Directory -Force + #& icacls "$Env:USERPROFILE/.ssh" /inheritance:r + #& icacls "$Env:USERPROFILE/.ssh" /grant:r "$Env:USERNAME":"(F)" } if (!(Test-Path -Path "$Env:USERPROFILE/.ssh/config")) { New-Item -Path "$Env:USERPROFILE/.ssh/config" -ItemType "file" -Value "" - & icacls "$Env:USERPROFILE/.ssh/config" /inheritance:r - & icacls "$Env:USERPROFILE/.ssh/config" /grant:r "%username%":"(F)" + #& icacls "$Env:USERPROFILE/.ssh/config" /inheritance:r + #& icacls "$Env:USERPROFILE/.ssh/config" /grant:r "$Env:USERNAME":"(F)" } -if (!(Test-Path -Path "$Env:USERPROFILE/.ssh/authorized_keys")) -{ - New-Item -Path "$Env:USERPROFILE/.ssh/authorized_keys" -ItemType "file" -Value "" - & icacls "$Env:USERPROFILE/.ssh/authorized_keys" /inheritance:r - & icacls "$Env:USERPROFILE/.ssh/authorized_keys" /grant:r "%username%":"(F)" -} +#if (!(Test-Path -Path "$Env:USERPROFILE/.ssh/authorized_keys")) +#{ +# New-Item -Path "$Env:USERPROFILE/.ssh/authorized_keys" -ItemType "file" -Value "" +# #& icacls "$Env:USERPROFILE/.ssh/authorized_keys" /inheritance:r +# #& icacls "$Env:USERPROFILE/.ssh/authorized_keys" /grant:r "$Env:USERNAME":"(F)" +#} if (!(Test-Path -Path "$Env:USERPROFILE/.ssh/id_rsa")) { - & ssh-keygen -b 2048 -t rsa -f "$Env:USERPROFILE/.ssh/id_rsa" -q -N "" + & ssh-keygen -b 2048 -t rsa -f "$Env:USERPROFILE/.ssh/id_rsa" -q -N """" echo "" }