2

I try create preinstalled user for Ubuntu 20.04. For this i add some entries in accordance with official docs, to /etc/cloud/cloud.cfg (config for cloud-init ) Old:

users:
   - default 

My:

 users:
   - default
   - name: myuser
     groups: myuser
     home: /home/myuser
     shell: /bin/bash
     hashed_passwd: $6$1234567890ABCDEF$3ytr6BmrrL5SVyQFBeHLveNX5ublgYVM8Cae3AS2g1gNsZgzenAKUzfvYRUGOIUk4YX5c6qngE5cx.JaiFe/k1

And next run on raspberry pi 4. After finish initialization (without errrors ) i try login on user and this step failed. After i see on /etc/shadow for check password creation, and find this line

/etc/shadow:

myuser:!$6$1234567890ABCDEF$3ytr6BmrrL5SVyQFBeHLveNX5ublgYVM8Cae3AS2g1gNsZgzenAKUzfvYRUGOIUk4YX5c6qngE5cx.JaiFe/k1:18717:0:99999:7:::

And seed reduntant '!' on password's begin. Without this '!' all worked good.

How can i fix this trouble?

Feuermann
  • 123
  • 4

1 Answers1

3

Yes this one got me as well its because of the following parameter and its default settings;-

lock_passwd: Optional. Disable password login. Default: true

So the fix is to set lock_passwd: false in your 'users' section as the default is to lock the password by prefixing a '!'

Simon Banks
  • 610
  • 1
  • 7
  • 15