Issue with SSH key in Azure

Prev Next

An issue has been observed with SSH keys when deploying an AppGate appliance in Azure. Azure occasionally fails to attach the SSH key to the provisioning data. The SSH public key is not placed under /home/cz/.ssh/authorized_keys and SSH access to the appliance is not working.

Resolution / Suggested Action

This issue is resolved in AppGate v6.4.13 and from v6.5.4. Upgrading to this version or a more recent version will resolve this issue.

Workaround and Mitigations

There are two workarounds that customers may follow to bypass this issue

Workaround 1

  1. Create the VM as usual.

  2. When it has started, go into the serial console (Connect->More ways to connect->Go to serial console).

  3. Copy-paste this string to make the console more usable:

    1. Copy-paste works. If you use the keyboard to paste, use Shift+Ctrl+V

    2. export TERM=xterm-256color; stty rows 55 columns 240

  4. Create a partial seed to apply the key that was lost in the provisioning:

    1. nano seed.json

  5. Copy-paste this string:

    1. {"local":{"users":[{"authorized_keys":"SSH_PUBKEY","nopasswd":true,"username":"cz"}]}}

  6. Replace SSH_PUBKEY with the pubkey. If the key was autogenerated, the pubkey can be found in the resource group.

  7. Hit Ctrl-O to save, then Ctrl-X to exit.

  8. The seed should be picked up immediately and now SSH and sudo should work as expected.


Workaround 2

Create the appliance in the AppGate Admin UI as usual, but when exporting the seed make sure to paste the key that is to be used, like this:


As Seed Type, pick the RAW option as shown above. Then when creating the VM in Azure, copy-paste the seed text into the Custom Data. (Create VM->Advanced->Custom data):