更改linux主机名用户名_如何在Linux上更改用户的用户名?

更改linux主机名用户名

I want to rename a user’s username on Linux. For example, rename user u1 to user1. How to change a user’s username on Linux?

我想在Linux上重命名用户的用户名。 例如,将用户u1重命名为user1。 如何在Linux上更改用户的用户名?

You can use the usermod command to modify the user’s info.

您可以使用usermod 命令来修改用户的信息。

For changing the user name, you can use the -l option:

要更改用户名,可以使用-l选项:

-l, –login NEW_LOGIN

-l –登录NEW_LOGIN

The name of the user will be changed from LOGIN to NEW_LOGIN. Nothing else is changed. In particular, the user’s home directory or mail spool should probably be renamed manually to reflect the new login name.

用户名将从LOGIN更改为NEW_LOGIN。 什么都没改变。 特别是,用户的主目录或邮件后台打印程序可能应该手动重命名以反映新的登录名。

For your specific example, the command will be (run as root or by sudo)

对于您的特定示例,命令将是(以root或sudo运行)

usermod -l user1 u1
Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。

翻译自: https://www.systutorials.com/how-to-change-a-users-username-on-linux/

更改linux主机名用户名

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值