Ubuntu20.04にユーザの追加、削除、確認の方法

2021年3月26日

1.homeディレクトリの確認
# ls -l /home
drwxr-xr-x 2 test01 test01 4096 3月 26 13:49 test01
drwxr-xr-x 2 test02 test02 4096 3月 26 13:50 test02
drwxr-xr-x 2 test03 test03 4096 3月 26 13:51 test03

2.ユーザの追加
# sudo adduser test02
Adding user `test02′ …
Adding new group `test02′ (1003) …
Adding new user `test02′ (1003) with group `test02′ …
Creating home directory `/home/test02′ …
Copying files from `/etc/skel’ …
New password:パスワード
Retype new password:パスワード
passwd: password updated successfully
Changing the user information for test02
Enter the new value, or press ENTER for the default
Full Name []: test02
Room Number []: test02
Work Phone []: test02
Home Phone []: test02
Other []: test02
Is the information correct? [Y/n] y

3.ユーザーの削除
書式
sudo userdel -r ユーザー名
# sudo userdel -r test01

Ubuntu

Posted by arkgame