linux - 在 Linux 中更改用户 ID

标签 linux uid

这里是我想做的事情的简短描述:

用户 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/

相关文章:

linux - 我正在尝试使用子进程模块来运行由 html 文件组成的终端命令

linux - 翻转粘贴命令输出

linux - 如何使用 ffmpeg 重叠和合并多个音频文件?

android - linux 中的 UID 是什么?

shell - 如何从/etc/passwd中提取最大的UID值?

android - ApplicationInfo().uid 是如何工作的,与系统应用程序有区别吗?

javascript - Silverlight & JS : Get the <RowDefinitions> Name or uid from XAML, 通过 Javascript

linux - 删除文件中匹配一个字符串但不匹配另一个字符串的行 - SED,BASH?

linux - container_of 未返回预期地址

Outlook 无法识别 .ics 文件中的自定义 UID,创建新事件(和新 ID)