Change user ID of user in Linux, but don't touch the files in the home directory
0
votes
0
answers
733
views
I want to change the user ID of
www-data
, but not touch the files in the home directory.
usermod man page:
-u, --uid UID
The new numerical value of the user's ID.
This value must be unique, unless the -o option is used. The value must be non-negative.
The user's mailbox, and any files which the user owns and which are located in the user's home directory will have the file
user ID changed automatically.
The ownership of files outside of the user's home directory must be fixed manually.
So is there a way to execute this without that side effect or do I have to edit /etc/passwd
manually using sed
or something like that?
Asked by Alex
(446 rep)
Apr 14, 2023, 08:43 AM