What if new_owner does not exist?

QuestionsQuestions8 SkillsProPermissions of FilesDec, 05 2025
078

If the new_owner specified in the chown command does not exist on the system, the command will fail, and you will receive an error message indicating that the user does not exist. For example:

sudo chown nonexistentuser example.txt

You might see an error like:

chown: nonexistentuser: no such user

To avoid this, ensure that the user you want to assign as the new owner has been created on the system. You can create a new user using the following command:

sudo adduser new_owner

Replace new_owner with the desired username. After creating the user, you can then use the chown command to change the file ownership.

0 Comments

no data
Be the first to share your comment!