2

I wanted ask you, how add user into Snappy Ubuntu Core. When I downloaded image of Ubuntu Core, there was user "ubuntu" with password "ubuntu" and sudo group. I'll write it with small tutorial (commands) for these who try to deal with same problem.

First at all I had to create new group and user. It was kind of tricky, becouse some filesystems was mounted as read only. So I had to find out what partitions are mounted as read only.

sudo mount | grep "(ro"

Now i have to remount that read only partitions.

sudo mount -o remount,rw /partition/name /where/to/mount

And repeat while there is some read only partitions. I had no clue what does that partitions contain. I just remounted all. After restart they will be read only again.

Now I can write everywhere on disc. So I created new group, and add new user. Everything was allright to point where I wanted to change password. When I try to run passwd to change user password, i get this:

(amd64)ubuntu@localhost:~$ sudo passwd payne
passwd: Authentication token manipulation error
passwd: password unchanged

I have no clue why it's happening. Do you have some ideas? I can add some extract of some configs and so on in the future. Just ask when you need some.

Something that seems strange is that

sudo cat /etc/shadow

will not show any user called ubuntu. There is only payne (that i add) and that line looks like

payne:!:16574:0:99999:7:::

and I don't know what does that exclamation marc (!) means.

It's Ubuntu Core (Ubuntu for cloads and devices) and there must be some other mechanism than that in Debian or Ubuntu. But it seems to me that default user with default password is not the best idea, even more when it's accessible from SSH.

Thanks for every advice, best regards, Jan Hák

Payne
  • 456
  • 6
  • 21
  • I have exactly the same problem! Did you find a solution? @Mateo : Your link seems to be broken. – kKdH Jul 28 '15 at 09:17

1 Answers1

2

To solve your problem mount the file-system as you already mentioned writeable and move the entry for your user from /etc/passwd to /var/lib/extrausers/passwd. Do the same with the entry in /etc/shadow and move it to /var/lib/extrausers/shadow. Then try again to change the password with:

sudo passwd <user-name>

Something that seems strange is that sudo cat /etc/shadow will not show any user called ubuntu.

You will find the default ubuntu user in /var/lib/extrausers/passwd and /var/lib/extrausers/shadow. These files are read by libnss-extrausers.


and I don't know what does that exclamation marc (!) means.

The exclamation mark (!) means that the password is locked. shadow(5)

kKdH
  • 512
  • 1
  • 8
  • 17