Connect AWS Lightsail Instance using Powershell and SSH key

Описание к видео Connect AWS Lightsail Instance using Powershell and SSH key

#devops #aws #lightsail #docker #ubuntu22

👉 Follow the below code and instructions to change the ssh key permission:

Move the ssh key (.pem) file to the target directory (.ssh) and run the below command on pwsh, but don't forget to replace the actual file
$pemFile = "$HOME\.ssh\test_ssh.pem"
$acl = Get-Acl $pemFile
$acl.SetAccessRuleProtection($true, $false) # Disable inheritance
$acl.Access | ForEach-Object { $acl.RemoveAccessRule($_) } # Remove existing rules

Add your user account with Full Control
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("$(whoami)", "FullControl", "Allow")
$acl.AddAccessRule($accessRule)
Set-Acl $pemFile $acl

Комментарии

Информация по комментариям в разработке