← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1952721] Re: passwd: insert a blank space in /etc/shadow

 

Thank you for filing a bug and making Ubuntu and cloud-init better.

The reason you are unable to login as jpcozar is because the default
behavior of cloud-init is to lock password logins and prefer key-based
login for ssh.

What you'll need is to both allow password-based ssh logins with
"ssh_pwauth: true" and make sure the password is unlocked for jpcozar
with "lock_passwd: false".


the complete userdata below:
#cloud-config
ssh_pwauth: true
users:
  - default
  - name: jpcozar
    groups: sudo
    shell: /bin/bash
    sudo: ALL=(ALL) NOPASSWD:ALL
    passwd: $6$ZE4Us0phF$/gVyOLzLIKI6uxCjYmkNnLxmtyZcicmZ8pXFTMM0P9TG14egqPDVm066uacHsuFw9vH1/i2fx5vTWpD/C//qc.

** Changed in: cloud-init
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1952721

Title:
  passwd:  insert a blank space in /etc/shadow

Status in cloud-init:
  Invalid

Bug description:
  Hello,
  I am using multipass 1.8.0.+win with a config file called cloud-init.yaml. I create my own user and insert the hash password of my user like that:

  users:
    - default
    - name: jpcozar
      groups: sudo
      shell: /bin/bash
      sudo:  ALL=(ALL) NOPASSWD:ALL
      passwd: $6$ZE4Us0phF$/gVyOLzLIKI6uxCjYmkNnLxmtyZcicmZ8pXFTMM0P9TG14egqPDVm066uacHsuFw9vH1/i2fx5vTWpD/C//qc.

  Once multipass has created the virtual machine, I can't login with
  user/passwd. If I check /etc/shadow, it inserts a blank space after
  "<login>:" so I can't login.

  jpcozar:
  $6$ZE4Us0phF$/gVyOLzLIKI6uxCjYmkNnLxmtyZcicmZ8pXFTMM0P9TG14egqPDVm066uacHsuFw9vH1/i2fx5vTWpD/C//qc.:18961:0:99999:7:::

  If I delete, such space, I can login
  jpcozar:$6$ZE4Us0phF$/gVyOLzLIKI6uxCjYmkNnLxmtyZcicmZ8pXFTMM0P9TG14egqPDVm066uacHsuFw9vH1/i2fx5vTWpD/C//qc.:18961:0:99999:7:::

  I have tried other options in cloud-init.yaml like
  passwd:$6$ZE4Us0phF$/gVyOLzLIKI6uxCjYmkNnLxmtyZcicmZ8pXFTMM0P9TG14egqPDVm066uacHsuFw9vH1/i2fx5vTWpD/C//qc.

  and it returns syntax error

  or 
  passwd: "$6$ZE4Us0phF$/gVyOLzLIKI6uxCjYmkNnLxmtyZcicmZ8pXFTMM0P9TG14egqPDVm066uacHsuFw9vH1/i2fx5vTWpD/C//qc."
  and it generates such blank spaces.

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1952721/+subscriptions



References