You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This started as trying to understand why my NixOS images weren't getting the authorized key for ssh set at all. It appears the user data of interest should be contained in obj.pkl (see directory structure). On Ubuntu, this appears to be a binary file format, but on NixOS it appears to be text. However, unlike on ubuntu, it clearly contains different information, and it clearly does not include an ssh-rsa public key (which it does on ubuntu: search for 'ssh-rsa' in the file).
I tried to largely model the ssh bits after my Ubuntu config (which is working - note: I didn't set up cloud-init on my Ubuntu image). Here is the Ubuntu cloud.cfg for completeness:
# The top level settings are used as module
# and system configuration.
# A set of users which may be applied and/or used by various modules
# when a 'default' entry is found it will reference the 'default_user'
# from the distro configuration specified below
users:
- default
# If this is set, 'root' will not be able to ssh in and they
# will get a message to login instead as the default $user
disable_root: true
# This will cause the set+update hostname module to not operate (if true)
preserve_hostname: false
# Example datasource config
# datasource:
# Ec2:
# metadata_urls: [ 'blah.com' ]
# timeout: 5 # (defaults to 50 seconds)
# max_wait: 10 # (defaults to 120 seconds)
# The modules that run in the 'init' stage
cloud_init_modules:
- migrator
- seed_random
- bootcmd
- write-files
- growpart
- resizefs
- disk_setup
- mounts
- set_hostname
- update_hostname
- update_etc_hosts
- ca-certs
- rsyslog
- users-groups
- ssh
# The modules that run in the 'config' stage
cloud_config_modules:
# Emit the cloud config ready event
# this can be used by upstart jobs for 'start on cloud-config'.
- emit_upstart
- snap
- snap_config # DEPRECATED- Drop in version 18.2
- ssh-import-id
- locale
- set-passwords
- grub-dpkg
- apt-pipelining
- apt-configure
- ubuntu-advantage
- ntp
- timezone
- disable-ec2-metadata
- runcmd
- byobu
# The modules that run in the 'final' stage
cloud_final_modules:
- snappy # DEPRECATED- Drop in version 18.2
- package-update-upgrade-install
- fan
- landscape
- lxd
- puppet
- chef
- mcollective
- salt-minion
- rightscale_userdata
- scripts-vendor
- scripts-per-once
- scripts-per-boot
- scripts-per-instance
- scripts-user
- ssh-authkey-fingerprints
- keys-to-console
- phone-home
- final-message
- power-state-change
# System and/or distro specific settings
# (not accessible to handlers/transforms)
system_info:
# This will affect which distro class gets used
distro: ubuntu
# Default user name + that default users groups (if added/used)
default_user:
name: ubuntu
lock_passwd: True
gecos: Ubuntu
groups: [adm, audio, cdrom, dialout, dip, floppy, lxd, netdev, plugdev, sudo, video]
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
shell: /bin/bash
# Automatically discover the best ntp_client
ntp_client: auto
# Other config here will be given to the distro class and/or path classes
paths:
cloud_dir: /var/lib/cloud/
templates_dir: /etc/cloud/templates/
upstart_dir: /etc/init/
package_mirrors:
- arches: [i386, amd64]
failsafe:
primary: http://archive.ubuntu.com/ubuntu
security: http://security.ubuntu.com/ubuntu
search:
primary:
- http://%(ec2_region)s.ec2.archive.ubuntu.com/ubuntu/
- http://%(availability_zone)s.clouds.archive.ubuntu.com/ubuntu/
- http://%(region)s.clouds.archive.ubuntu.com/ubuntu/
security: []
- arches: [armhf, armel, default]
failsafe:
primary: http://ports.ubuntu.com/ubuntu-ports
security: http://ports.ubuntu.com/ubuntu-ports
ssh_svcname: ssh
You should be able to test this out on any system with cloud init installed on a cloud where the cloud-init server IP on the cloud controller is 169.254.169.254 (this is standard).
Technical details
system: "x86_64-linux"
host os: Linux 4.14.79, NixOS, 18.03.133361.21b7f59ae12 (Impala)
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
Search for maintainers and people that previously touched the related code and @ mention them in a comment.
Issue description
This started as trying to understand why my NixOS images weren't getting the authorized key for ssh set at all. It appears the user data of interest should be contained in
obj.pkl
(see directory structure). On Ubuntu, this appears to be a binary file format, but on NixOS it appears to be text. However, unlike on ubuntu, it clearly contains different information, and it clearly does not include an ssh-rsa public key (which it does on ubuntu: search for 'ssh-rsa' in the file).Steps to reproduce
Here is the relevant bit of my configuration.nix:
I tried to largely model the ssh bits after my Ubuntu config (which is working - note: I didn't set up cloud-init on my Ubuntu image). Here is the Ubuntu
cloud.cfg
for completeness:You should be able to test this out on any system with cloud init installed on a cloud where the cloud-init server IP on the cloud controller is 169.254.169.254 (this is standard).
Technical details
"x86_64-linux"
Linux 4.14.79, NixOS, 18.03.133361.21b7f59ae12 (Impala)
yes
no
nix-env (Nix) 2.0.4
""
"nixos-18.03.133361.21b7f59ae12"
/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
The text was updated successfully, but these errors were encountered: