[centOS 7 adduser] 유저 추가하기/지우기

2021. 6. 29. 20:15Linux

728x90
반응형

유저 추가하기 - Adding Users

 

유저 추가 - add user 

adduser username

비밀번호 설정 - set password

passwd username

 

권환 설정 - Granting Sudo Privileges

 

Use the usermod command to add the user to the wheel group

By default, on CentOS, members of the wheel group have sudo privileges.

wheel의 맴버는 기본적으로 CentOS에서 sudo 권한이 주어진다.

usermod -aG wheel username

 

유저 삭제 - Deleting Users

 

delete the user without deleting any of their files

userdel username

 

delete the user’s home directory along with the user account itself, 

userdel -r username

 

 

su - username

 

 

As the new user, verify that you can use sudo by prepending “sudo” to the command that you want to run with superuser privileges.

sudo command_to_run

For example, you can list the contents of the /root directory, which is normally only accessible to the root user.

sudo ls -la /root

The first time you use sudo in a session, you will be prompted for the password of the user account

반응형