首页 > 代码库 > Ubuntu user switch
Ubuntu user switch
To list all users you can use:
cut -d: -f1 /etc/passwd
To add a new user you can use:
sudo adduser new_username
To remove/delete a user, first you can use:
sudo userdel username
Then you may want to delete the home directory for the deleted user account :
sudo rm -r /home/username
(Please use with caution the above command!)
To modify the username of a user:
usermod -l new_username old_username
To change the password for a user:
sudo passwd username
To change the shell for a user:
sudo chsh username
To change the details for a user (for example real name):
sudo chfn username
$ whoamiuser1$ su - user2Password:$ whoamiuser2$ exitlogout
Ubuntu user switch
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。