cloud-agent icon indicating copy to clipboard operation
cloud-agent copied to clipboard

Adding the azure-user and doas issue / segmentation fault

Open Keithsc opened this issue 4 years ago • 1 comments

I need some advice on how to use cloud-agent on Azure as my /etc/doas.conf file is changing and I am unsure what the correct procedure is for "pre adding users" to my VM.

I have a local virtualbox VM running a clean install of OpenBSD 6.7 where I install the package cloud-agent and I do the following.

  1. Add my user "keith". 2 Add myself to the Wheel group

  2. Append my public key to /home/keith/.ssh/authorised_keys

  3. Create /etc/doas.conf and add. permit nopass :wheel

  4. Create /etc/hostname.hvn0 and add.

dhcp !/usr/local/libexec/cloud-agent "$if"

I then upload my vhd file to Azure and create and start a new VM, I am then able to ssh into the VM using my user keith and my private key, But I see there's a new user azure-user and the /etc/doas.conf file has changed so that I am unable to run doas as user keith.

permit keepenv nopass azure-user as root permit keepenv nopass root

I am not sure if I should create the azure-user before I upload the image to azure, I tried using "-U keith" to the cloud-agent command but the azure-user was still created somehome and if I try running cloud-agent directly I get a segmenttion fault ?

/usr/local/libexec/cloud-agent -c azure -v hvn0

trycloud: azure main: azure Segmentation fault (core dumped)

Hope this makes sense Keith.

Keithsc avatar Jul 11 '20 09:07 Keithsc

cloud-agent creates whatever user you specify, and azure-user is the default. Rather than just letting Azure pick that, you'd specify adminUsername explicitly in osProfile (ARM template) or --admin-username (az CLI). (But you'll need to apply #10 first or it won't add the ssh key to authorized_keys.)

backerman avatar Jul 28 '20 04:07 backerman