0

How would I change the ownership of a recently made file to root user ownership from its original owner? Every time I type in the following (below), I get a message saying that it can't change the ownership.

For Example:

touch myfile
chown root myfile
Tony Lancer
  • 1,003

1 Answers1

3

Unprivileged user can't change ownership of a file. To do so, you must be a privileged user or use sudo before chown command. Consider that you must be sudoer to issue sudo.

touch myfile
sudo chown root myfile
J.Franks
  • 146