1

I want to change default username in raspi4 ubuntu installation.

In this image default username and password are ubuntu/ubuntu

However I want to change these default settings to something like newname/0123456(numeric only password).

How do I change user-data cloudinit file?

Note that I know numeric password is so weak, I just interested in how to do it.

2 Answers2

1

First, make add a user using

sudo useradd -m <user>-G sudo

Replace <user> with the user name. Create a password for user <user> using

mkpasswd -m sha-512 <password> <salt>

Replace <password> with your desired password and in place of <salt>, put any random text. Change the root/etc/shadow file with the new password above. Delete the string between the 1st and 2nd : colons on the line starting with <user>. Paste the new value between these colons.

Tejas Lotlikar
  • 2,945
  • 5
  • 17
  • 26
0

Sorry, but I can't help you with your Username problem.

You can type passwd and then enter you're current password and then you're replacement.

For your username problem, maybe this will help? Link