系统相关
首页 > 系统相关> > linux – 当尝试更改用户名时,终端告诉我用户当前正被进程使用

linux – 当尝试更改用户名时,终端告诉我用户当前正被进程使用

作者:互联网

我试图更改我的用户名,根据建议here然后运行以下命令后:

CurrentName@HostName ~ $sudo usermod -l TheNameIWantToChange -d /home/TheNameIWantToChange -m CurrentName

终端响应:

CurrentName@HostName ~ $usermod: user CurrentName is currently used by process 2491

用户名保持不变.有人知道我怎么能解决这个问题并改变我的用户名吗?

解决方法:

引用man usermod:

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

因此,您需要确保您重命名的用户未登录.

另外,我注意到你没有以root身份运行它.以root身份运行,或使用“sudo usermod”运行.

标签:linux,ubuntu,users,linux-mint
来源: https://codeday.me/bug/20190809/1629882.html