尝试更改用户名时,终端会告诉我该进程当前正在使用该用户

悖论

我想改变我的用户名,按照建议在这里运行以下命令后,但是:

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

终端回应:

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

用户名保持不变。有人知道我该如何解决这个问题并更改我的用户名吗?

Seumasmac

引用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”运行。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章