这里是我想做的事情的简短描述:
用户 tom 的 ID 为 1000。我正在调用 usermod -u 2000 tom
。
除了 tom 的 id 变为 2000 之外,究竟发生了什么?此用户拥有的文件和文件夹是否仍归此用户所有,还是我必须再次明确设置所有者?
感谢您的帮助!
最佳答案
usermod
将更改用户主目录中用户文件的权限。他的主目录之外的文件必须手动更改。
man usermod 列出了以下注意事项:
You must make certain that the named user is not executing any processes when this command is being executed if the user's numerical user ID, the user's name, or the user's home directory is being changed. usermod checks this on Linux, but only check if the user is logged in according to utmp on other architectures.
You must change the owner of any crontab files or at jobs manually.
You must make any changes involving NIS on the NIS server.
关于linux - 在 Linux 中更改用户 ID,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18248056/