Cách tạo user trên Ubuntu từ dòng lệnh

2

adduser <username>

Lệnh này đơn giản hơn useradd bởi bạn không cần phải đưa vào các tham số, lệnh này sẽ tự động hiển thị các tùy chọn để bạn nhập vào.

geek@ubuntuServ:/etc/skel$ sudo adduser thegeek
Password:
Adding user ‘thegeek’…
Adding new group ‘thegeek’ (1004).
Adding new user ‘thegeek’ (1004) with group ‘thegeek’.
Creating home directory ‘/home/thegeek’.
Copying files from ‘/etc/skel’
Enter new UNIX password:
Retype new UNIX password:
No password supplied
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for thegeek
Enter the new value, or press ENTER for the default
Full Name []: The Geek
Room Number []: 0
Work Phone []: 555-1212
Home Phone []: 555-1212
Other []:
Is the information correct? [y/N] y