1

AKS- Can't log into one of the worker nodes (VM). I assigned the public IP as per https://gist.github.com/tsaarni/624d5406e442f08fe11083169c059a68 but still no luck. I get the error below:

JohnDoeMac:.kube john_doe$ ssh azureuser@52.191.195.250 Permission denied (publickey).

Here subscription ID looks like: e84ff951-xxxxxxxxxxxx

codeRelix
  • 11
  • 3

2 Answers2

3

if you create AKS from Azure portal, you can specify the user name of VM.

at that case, user name is not azureuser any more

you can find out the user name and public key from Azure portal

enter image description here

Community
  • 1
  • 1
SILENCE
  • 225
  • 3
  • 8
2

sushainMac:.kube sushain_chhangani$ ssh azureuser@52.191.195.250 Permission denied (publickey).

Please find your private key then use this script to SSH:

ssh azureuser@52.191.195.250 -i ~/.ssh/<your private key>

Update:

When we use CLI 2.0 to create AKS, we can find the key here:

enter image description here

Update2:

Reset public key here:

enter image description here

Jason Ye
  • 13,710
  • 2
  • 16
  • 25
  • How to find my private key? – codeRelix Jan 09 '18 at 06:03
  • @codeRelix how do you create this AKS, like [this](https://learn.microsoft.com/en-us/azure/aks/kubernetes-walkthrough)? `az aks create --resource-group myResourceGroup --name myK8sCluster --node-count 1 --generate-ssh-keys`? Or Portal? – Jason Ye Jan 09 '18 at 06:04
  • @codeRelix we can find the private key in `~/.ssh`, please check it:) – Jason Ye Jan 09 '18 at 06:10
  • @codeRelix maybe your key in this folder `~/.ssh/id_rsa`, please try to SSH it with this command `ssh azureuser@52.191.195.250 -i ~/.ssh/id_rsa`. – Jason Ye Jan 09 '18 at 06:13
  • @codeRelix How many keys in your `~/.ssh`? could you please try them? – Jason Ye Jan 09 '18 at 06:25
  • There has to be an easier wa – codeRelix Jan 09 '18 at 06:37
  • @codeRelix we can use `ssh-keygen` to get new public key and private key, then use Azure portal to reset public Key, then use new private key to SSH it. – Jason Ye Jan 09 '18 at 06:46
  • @codeRelix Just checking in to see if the information provided was helpful. Please let me know if you would like further assistance. – Jason Ye Jan 10 '18 at 01:08
  • @codeRelix does that work for you? please let me know if you need more help. – Jason Ye Jan 16 '18 at 06:58
  • @codeRelix Does reset public key works for you? please let me know if you need more help:) – Jason Ye Jan 17 '18 at 02:10