# Edge365 ssh aks node
1. Prepare your RSA key ready
2. Configuring VMSS and update VMs under it
3. Have a azure VM that can connect to node
4. Copy RSA key to the above VM
5. VM can ssh into node
### 1. Prepare your RSA key ready
* copy ssh key from azure resource
* ssh-keygen -m PEM -t rsa -b 4096
You need to prepare two files, id_rsa(private-key) and id_rsa.pub(public-key).
### 2. Configuring VMSS and update VMs under it
* Update public ssh key in vm node under VMSS.
You need to add VMSS extension VMAccessForLinux
--resource-group MC_edge365_edge365_southeastasia(find it in resource-group portal)
--vmss-name aks-agentpool-XXXXXXX
--name VMAccessForLinux
--protected-settings "{\"username\":\"azureuser\",\"ssh_key\":\"public ssh key here\"
```
az vmss extension set --resource-group MC_EDGE365-DEV_EDGE365-DEV_SOUTHEASTASIA --vmss-name aks-agentpool-61981316-vmss --name VMAccessForLinux --publisher Microsoft.OSTCExtensions --version 1.4 --protected-settings "{\"username\":\"azureuser\",\"ssh_key\":\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDKYGM+1zDehnj/uVeEXkZjui5vagTk51Lk4hmtgU/xqJka5WrjJwWDx0zW9k0WKsKbVfMqGc6OFTriw6LA1khaZQLT/NedP7xoBZAHPUsigJdc8y4YkO3qz7boAGNNbZZdlNixV9PFab7OSk0uDdaYkcwG3dQ7iJAxgrXsqSgkDaZuhNCVsAPHsKSuPMDvK3LaHe4lGq4uW1tnuenhaqx393yVNUjUaeu+dPDBu94CWyX4m5kD8WMjUWg4h2z6W+8PXzLPEMyiEo6DPO+SejBCRwQ74ggRXEGp9YtJ1clkoxfjAJ47ntwV7jo8bckPjVM+umtfR9c/w//R5kKTHlg7CSlAEXQCIcQ3peLlYkYxmzVAl6OZWxSpOwI65spFBK0hs8YEP813Y8wJq9uXj/LVJo0nJuX1EgaY4poE3MzV0lbCxGe0R9BbDQn4L9QwJCFm5/KIf2D4j1+tHq6qh/WvVsbYvlwn2DNmph86NNDckHwRsXV6LA50apFryOsWcr0=\"}
```
* update VMSS instances
`az vmss update-instances --instance-ids '*' --resource-group MC_edge365-dev_edge365-dev_southeastasia --name aks-agentpool-61981316-vmss`
### 3. Have a azure VM that can connect to node
Find a azure vm like edge365-mongodb-0 which can connect to vmss instances through private-ip
### 4. Copy RSA key to the above VM
Login into azure vm and copy private-key (id_rsa) from step1
chmod 400 private-key
### 5. VM can ssh into node
You can ssh to aks node by ssh -i private-key azureuser@private-ip
```
ssh -i id_rsa azureuser@10.225.0.5
```
reference: https://ystatit.medium.com/azure-ssh-into-aks-nodes-471c07ad91ef
###### tags: `Edge365`