# Connecting to Azure VM from Windows: A Step-by-Step Guide to Resolving Errors

Connecting to an Azure VM from windows can be a bit tricky and you may get errors like

*WARNING: UNPROTECTED PRIVATE KEY FILE! Permissions for ' ' are too open, It is required that your private key files are NOT accessible by others This private key will be ignored. ,etc.*

This is a quick guide to solving that issue and connecting to the VM.

Step 1:

Before this, have a copy of the .pem file, if in case anything doesn't work out, you can always start from scratch.  
Right-click on the .pem file, go to security and click advanced.

Step 2:

Click Disable inheritance, and go with "Convert inherited permissions into explicit permissions on this object".

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1674550361465/f6c9b959-13aa-4bb9-a2ba-ad453488f9b8.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1674550384606/ef653eb9-8aad-4206-90e9-22f4f1523927.png align="center")

Remove the accounts, Except "SYSTEM" and "Administrators".

Click Apply and Okay.

Step 4:

Now open CMD or powershell as an administrator.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1674550594027/0b670aff-fad7-470d-9996-967ea49484ce.png align="center")

  

Step 5:  
Now the command which is mentioned in the docs will work as expected.

```bash
ssh -i path-to-the-pem-file user@0.0.0.0
```

  
Hope it helps, Have a great day! See you on the next one!
