Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Add new users under Ubuntu16.04

Shulou Source: shulou.com Published: 2022-06-03 05:41:38 10月02日 Update

In some cases, ubuntu uses the new user name of useradd, and you cannot see the newly created user folder under the home folder, for example:

Root@worker:/home/kuku# useradd sparkroot@worker:/home/kuku# passwd sparkEnter new UNIX password: Retype new UNIX password: passwd: password updated successfullyroot@worker:/home/kuku# cd.. root@worker:/home# lskukuroot@worker:/home#

It is found that the folder for spark cannot be found, so it will be re-established in the following way

Delete the spark user first

Root@worker:/home# userdel sparkroot@worker:/home# useradd-r-m-s / bin/bash sparkroot@worker:/home# passwd sparkEnter new UNIX password: Retype new UNIX password: passwd: password updated successfullyroot@worker:/home# lskuku sparkroot@worker:/home#

If you want to add root permissions to a new user,

Root@worker:/home#chmod + w / etc/sudoersroot@worker:/home# vim / etc/sudoers

Add

Just save it!

If you want to delete a user,

Root@worker:/home# userdel-r sparkuserdel: spark mail spool (/ var/mail/spark) not foundroot@worker:/home# lskukuroot@worker:/home#

Can

Tags: User file folder situation method permission user name Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Redmi Shulou Information OPPO Reno vpn