리눅스 유저 생성
[root@localhost home]# useradd test-1
그룹 생성
[root@localhost home]# groupadd group_test
그룹에 유저 추가
root@localhost home]# gpasswd -a test-1 group_test
group_test 그룹에 유저 test-1이 정상적으로 들어가있다 근데 home에서 보면 아직도 자신에 유저그룹을 사용중인게 보여진다 유저 test-1은 group_test와 test-1 그룹을 2개 사용 중이다
처음 사용한건 usermod -G 새로운 그룹(group_test)에 추가를 시켰고
[root@localhost home]# usermod -g group_test test-1
usermod -g 를 사용하게 되면 기본그룹으로 설정되어있는 test-1그룹대신 group_test 그룹으로 변경이 가능하다
주의 사항
usermod 사용 할때 기본 그룹을 변경하는 건데 여기서 보면 test-2 유저를 group_test2를 기본 그룹으로 설정은 가능하다 그러나 tail /etc/group를 확인해보면 group_test그룹에는 속해 있는걸 확인 할 수 있지만 group_test2는 비어있는걸 확인 할수 있다
그룹에 유저 생성
[root@localhost home]# gpasswd -a test-2 group_test2
위 사진과 다르게 group_test2에 유저가 추가되었고 정상적인 그룹에 유저가 된다
[linux] centos7 linux ssh 접속하기 생성 (0) | 2022.03.17 |
---|---|
[linux] centos7 서버,디비 자동 실행 httpd,mysql (0) | 2022.03.15 |
[Linux] linux yum update 오류 Another app is currently holding the yum lock; waiting for it to exit. (0) | 2022.02.18 |
[Linux]linux 사용자 추가,삭제 그룹 생성,삭제,관리 (0) | 2022.02.16 |
[Liunx] This virtual machine appears to be in use. (0) | 2021.11.15 |
댓글 영역