# option 1
sudo adduser username
# option 2
sudo useradd -m username
option1: user 생성(모든 것을 한번에 all in one으로 생성)
option2: user 생성 (-m 옵션은 홈디렉토리도 함께 생성하는 것을 의미)
-g 그룹 지정
-d 디렉토리 지정
Adding user `username' ...
Adding new group `username' (1001) ...
Adding new user `username' (1001) with group `username' ...
Creating home directory `/home/username' ...
Copying files from `/etc/skel' ...
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for username
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n]
sudo passwd username
tail -n 3 /etc/passwd
# /etc/sudoers 파일을 열어줌
sudo visudo
# 파일 하단에 아래 문구를 추가
username ALL=(ALL) ALL # sudo 명령어 실행시 password 입력
username ALL=(ALL) NOPASSWD: ALL # password 생략
# username으로 로그인
su username
# root로 전환
sudo -i
deluser username
Tip) 기본 명령어 모음
아래 사이트 참고
https://itholic.github.io/linux-basic-command/