0

I have used Ubuntu Linux for at least 10 years, and had a problem. So I re-installed 20.04 and forgot my 'user id' and gave it a new one. Installation went well, but all those disks not involved have the old user id.. I tried CHOWN a few times... complete failure.

What can I do, other than reinstall with the correct user id?

1 Answers1

2

chown cannot be a complete failure. It is the method to change ownerschip to the new uid. To change ownership in a directory Documents recursively on all files and subdirectories, one can do sudo chown -R $USER:$USER ~/Documents. Root (sudo) must do that because a normal user is not allowed to change ownerships of files of other users. $USER will be substituted by the login of the current user, and ~ expands to the home directory of the current user.

Alternatively, you can change the uid of your current user to match the uid to the old uid.

The first user created on a new Ubuntu system always has uid 1000.

vanadium
  • 88,010
  • $ ls -n will show the NUMERIC user and group ID's - for changing it on he newly created user. – Hannu Apr 09 '22 at 17:10