It is best to use adduser to create a user in ubuntu.

Source: Internet
Author: User

 

It is best to use adduser for ubuntu users. Although adduser and useradd are the same in other linux operating systems, the user home directory with the same name is not created when I use useradd In ubuntu.

Example: adduser user1

In this way, the user's home directory will be automatically created to create a group with the same name as the user.

 

If you have deleted the home directory and have not deleted the user, you can use the following command to recreate the home directory.

 

Sudo mkdir/home/user # Here, the user in/home/user should be the same as your original user name.

Sudo chown-R user: user/home/user # Here the user: user should be changed to your previous "user name: user Group" Format

Sudo chmod-R 755/home/user # grant permissions to 755

 

755 can be viewed and executed by users in other groups in the same group. If you do not want to view the permissions of users in the same group or other groups, you can set the permission to 700.

 

Author ylq365

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.