[Troubleshooting][For AzureAD user] Permission denied (publickey) problem
If you want to access remote system using command prompt and you are an AzureAD user, you’ll meet this trouble I thought.
When I’m working, I use Windows as development environment. And I don’t like using application if that can work on command prompt.
When I tried to access remote server using
ssh command, I met one problem something like this.
I need over 1 hour to solve this problem, so I record what I did.
I hope you guys don’t suffer with this problem.
If you are Azure AD user and you want to use ssh command on command prompt, follow me. I’ll give you a solution!
Grant access right to AzureAD user
I logged in Windows as AzureAD user. At that time we cannot find user using file’s properties.
How can we grant access right to AzureAD user?
Enter this command on your command prompt.
CACLS <filename> /G AzureAD¥<username>:R
/E tags and
C as permission, but when you grant access right, you should enter command without that tags and with
If you want to know more detail things about CACLS, please read Microsoft official documents.
Applies To: Windows Server (Semi-Annual Channel), Windows Server 2016, Windows Server 2012 R2, Windows Server 2012…
Check file’s properties. If you can see properties like as shown below, your tasks are done!
ssh -i private-key username@ipAddress -o ServerAliveInternelval=30
ServerAliveInternelval=30 option because I want to keep the connection alive.