Linuxでは、ユーザーのユーザーIDを変更しますが、ホームディレクトリのファイルに触れないでください。

Linuxでは、ユーザーのユーザーIDを変更しますが、ホームディレクトリのファイルに触れないでください。

ユーザーIDを変更したいのですが、www-dataホームディレクトリのファイルは変更したくありません。

usermod のマニュアルページ:

   -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.

それでは、副作用なしにこれを行う方法はありますか?または、/etc/passwdこのようなものを使用して手動で編集する必要がありますか?sed

ベストアンサー1

おすすめ記事