Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the azure-user and doas issue / segmentation fault #11

Open
Keithsc opened this issue Jul 11, 2020 · 1 comment
Open

Adding the azure-user and doas issue / segmentation fault #11

Keithsc opened this issue Jul 11, 2020 · 1 comment

Comments

@Keithsc
Copy link

Keithsc commented Jul 11, 2020

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.

@backerman
Copy link

backerman commented Jul 28, 2020

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants