/srv/irclogs.ubuntu.com/2022/01/27/#cloud-init.txt

holmanbblackboxsw: I got some initial comments up on the A-D schema PR. More to come tomorrow00:11
meenasomebody reminded me that i need to submit a fix from almost a year ago: https://bsd.network/@brd/107678887598348834 / https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=25433908:39
ubottubugs.freebsd.org bug 254339 in Ports & Packages "net/cloud-init: fix modifying rc.conf in cc_salt_minion" [Affects Only Me, Open]08:39
=== raekye2 is now known as raekye
holmanbmeena: Do you know of any docs describing running cloud-init with freebsd? I wouldn't know how to test such a PR.16:22
meenaholmanb: you install it, and enable the service 19:43
meenaoh, and enable logging, or else the whole thing is going to be useless 19:44
meenapkg install net/cloud-init19:45
meenasysrc cloudinit_enable="YES"19:45
meenain /usr/local/etc/cloud-init/ subdir make it so the logging config is included, so you're not flying blind 19:48
holmanbmeena: thanks!19:55
blackboxswholmanb: I mentioned at standup today as far as setup of AWS Nitro-based systems with IPv6 IMDS I followed this guide (+ an initial pycloudlib Ec2 instance launch with dual-stack via ec2.get_or_create_vpc() call). https://aws.amazon.com/blogs/networking-and-content-delivery/introducing-ipv6-only-subnets-and-ec2-instances/21:44
blackboxswI'm now able to confirm access to Ec2's IPv6 IMDS on my end. will run through a couple of tests locally and see if I can't shape up a PR for pycloudlib to make this easier. Right now to get access to IPv6 only I'm doing (probably a silly thing) ssh IPv4 into my dual-stack instance as a bastion host that can then ssh into the IPv6 only instance.21:45
holmanbblackboxsw: thanks for the ptr22:40
blackboxswwhat remains to be understood is how I can not seem to scp into the instance, but can ssh in.22:42
echeadleI am trying to use cloud-init on Ubuntu server 21.10.   I am using packer. I start the process and watch the progress on a virtualbox display.   The graphical installer always runs and stops the process.  This did not happen on 20.04.  Is there an easy way to disable the graphical installer so cloud-init can finish?22:56
blackboxswone interesting "cost" I'm seeing on these systems with Nitro IPv6 IMDS is a really slow crawl of metadata..   IPv6(+03.58600s) versus ipv4(+00.19400s)22:57
holmanb@blackboxsw: are you using a commit with ipv4 before ipv6?22:59
blackboxswholmanb: no I was just trying to reorder ipv6 first intentionally to see how it'd behave22:59
holmanbahh, huh22:59
holmanbinteresting 22:59
blackboxswyeah holmanb not a logic problem in your implementation, but an IMDS IPv6 implementation prob I think23:00
holmanbcurious23:00
holmanbcurious if aws devs are aware of that23:01
blackboxswecheadle: thanks for the question, I'm presuming you might be using  Ubuntu server live iso maybe which is subiquity mased? Can you walk us through steps to reproduce the problem?23:01
holmanb3.5s is significant23:01
blackboxsws/subiquity mased/subiquity-based installer ISOs/ ?23:01
blackboxswholmanb: yeah 23:01
blackboxswholmanb: yeah I need to get more data on that to see where the hangup is. it might be misconfiguration of routes not sure. haven't gotten more that a high-level smell there so far23:02
echeadleSorry, yes it is the live server: https://releases.ubuntu.com/21.10/ubuntu-21.10-live-server-amd64.iso"23:02
echeadleIn the boot_command I have "autoinstall ds=nocloud-net;s=http://{{ .HTTPIP }}:{{ .HTTPPort }}/23:03
minimalblackboxsw: on a related IPv6 note, the fallback DHCP in cloud-init is IPv4 only currently23:04
blackboxswecheadle: for a "headless" deployment you might want to use stock ubuntu server images (not server-live ISOs): https://cloud-images.ubuntu.com/impish/current/23:04
echeadleIt seems to find the user-data file and seems to run. But the ubuntu installer always runs after cloud-init runs.  On 20.04 things rand fine23:04
echeadleOk thanks.  I am new to Ubuntu and in the examples I was following, they used the live server.23:05
echeadleI appreciate the help.23:06
blackboxswecheadle: somewhat related, I think some of the interactions with cloud-init and server-live images are not exactly desirable for folks trying to roll their own images. See comment here for details23:06
blackboxswecheadle: https://bugs.launchpad.net/subiquity/+bug/1958377/comments/1123:06
ubottuLaunchpad bug 1958377 in cloud-init (Ubuntu) "cloud-init does not apply network configuration from NoCloud resource" [Undecided, Incomplete]23:06
echeadlefantastic23:06
blackboxswecheadle: to better educate me, are you following any public packer procedure/docs that you could reference for us?23:06
blackboxswthen I can better understand use-cases folks run into23:07
echeadleI started with Jeff Geerling's example repo found on github at  geerlingguy/packer-boxes.23:09
echeadlehttps://imagineer.in/blog/packer-build-for-ubuntu-20-04/23:09
echeadlehttps://github.com/Praseetha-KR/packer-ubuntu23:09
blackboxswminimal: +1 and yes thanks, I'm going through the paces of exercising holmanb's https://github.com/canonical/cloud-init/pull/116023:09
ubottuPull 1160 in canonical/cloud-init "Add ec2 IPv6 IMDS Support (SC-336)" [Open]23:09
echeadlehttps://www.golinuxcloud.com/generate-user-data-file-ubuntu-20-04/23:10
blackboxsw... per ec2/ipv6: and testing our failure paths, including our dhcp4-only sandboxed dhclient action on an IPv6 only box.  some rough edges for us to understand/sort there23:10
blackboxswthanks echeadle 23:10
echeadlewere three url's I found. Then just looking around stackoverflow and comments in askubunty23:10
minimalblackboxsw: yeah I know. I was recently trying to do IPv6-only with NoCloud via seed-urls and hit the problem of no IPv6 DHCP which defeated the IPv6-only aspect23:11
blackboxswminimal: yeah I totally recall  seeing your conversation here back and forth on that. That is definitely a gap we hope to shore up in the short term here.23:12
* blackboxsw needs to re-read that in logs again for context 23:12
minimalblackboxsw: it was to do with there (obviously) being no way to provide network-config and so the fallback kicked in23:13
minimalblackboxsw: unrelated question: would there be any object to writing cloud-init code that extracts data from /etc/shadow? I was going to write a PR for the issue I flagged a while ago about needing to prefix user passwords with a "*" rather than using the lock_passwd option but obviously code cannot prefix an existing hashed password without accessing /etc/shadow23:15
minimals/object/objection/23:15
blackboxswahh, ok. I was hoping we can grow both dhcp4/6 support for fallback as well as EphemeralDHCPv4/EphemeralDHCPv6 for pre-networking discovery23:15
blackboxswminimal: my security bells are going off.  I vaguely recall seeing discussion on the /etc/shadow * character. but can't place the orig problem.   this was due to passwd -l or something?23:20
minimalblackboxsw: its to do with openssh specifically - if a password is locked AND if PAM is not enabled for openssh then it refused to let key-based ssh work for that account23:22
minimalI assume most distros have PAM compiled for openssh and also the sshd_config has PAM enabled by default - in my case Alpine provided to distinct packages for openssh (with no PAM compiled in) and openssh-pam. Even with PAM support present someone may not wish to have it enabled for openssh. So I wanted to write functionality to prefix the user's password with "*", rather than "!" (which signifies a locked password)23:24
minimalhowever there seems to be no utility that will do the "*" prefix (unlike "passwd -l") and so I'd need to read /etc/shadow in order to get any existing hash to prefix it23:24
blackboxsw+1 and interesting condition there. I can't claim to understand the implications fully yet and I need to read some more man pages to feel super comfortable about the write direct to /etc/shadow. I'll take that question to our security team too to see if there are adverse concerns there. The only thing I'd like to understand more fully is whether there were a preferred utility that did that for you anyway outside of going 23:26
blackboxswinto /etc/shadow directly to make that change (in case /etc/shadow format changed in the future etc )23:26
minimalblackboxsw: that's my point, I have found no util that provides a means to prefix a hashed password23:28
minimalwithout this I have no means to "lock" an account to prevent password access (in general, not just via SSH) yet permit key-based SSH access to the same account23:29
blackboxswminimal: +1, I've almost understood. Strange to me that a util doesn't exist to do this, but I admit being in the shallow end of the pool here.23:32
minimalblackboxsw: I guess there are not many use cases for wanted to add an arbitary prefix to a hashed password entry23:33
minimalusermod -p "*" is no use as that looses any existing password (and so this change can't be reverted later)23:35
blackboxswI can promise to make sure the right eyes see a PR like this to vet any concerns and I'll spend a bit more time understanding the potential impact of direct modification.  Given that chage and passwd, usermod  and their related tools  play around  in that space too writing/updating the file is a fairly well trodden by these tools. I'll spend some time reading through man pages there to see if anything else that could 23:38
blackboxswsuffice.23:38
minimalblackboxsw: I believe this is the relevant line in openssh: https://github.com/openssh/openssh-portable/blob/master/auth.c#L13623:38
minimalnote the "!options.use_pam" part - its treatment is condition on whether PAM is enabled/disabled23:39
minimalin general it seems that BSDs and Linux treat locked accounts differently - according to the Linux manpages a locked account is locked for password access, not for all access (i.e. SSH key). I think BSDs treat locked to mean locked in all/most cases23:40
minimalI sat down yesterday to write a c-i PR for this and then ti dawned on me that I didn't know of any util to add the "*" prefix....doh!23:41
blackboxswahh ok. I'm basically at your square one yesterday :) 23:42
blackboxswjust trying to vet that it is not the case so I can understand context23:42
minimalblackboxsw: the openssh "problem" is easy to see - edit /etc/ssh/sshd_config and change UsePAM to "no", restart sshd, and then try and ssh in and see it refused23:46
minimalfor an account with a locked password that is....23:46

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!