본문 바로가기

Linux

Linux Group 생성

728x90
반응형

저번 포스팅에서 second user와 새로운 group을 만들었기 때문에

새로운 그룹을 생성하고 거기에 유저를 추가해보겠다. 

 

By default id command shows the the user and group names and numeric IDs, 
of the calling process i.e. the current user who runs the id command on screen. 
If a login name or user ID ([UserNameHere]) given on command line, 
the user and group IDs of that user are displayed.

- sudo id [username]

: 현재 id 혹은 작성한 id의 정보를 알려주는 명령어 

- usermod -G [groupname] [username]

: user가 속한 secondary group을 변경 (-G) / primary group을 변경하려면 (-g) 옵션

 

- usermod -G [groupname] -a [username]

: username에 또다른 second group을 추가하기 위해서 사용하는 명령어 (-a)추가

 

- gpasswd -a [username] [groupname]

: username 계정에 group을 추가하는 명령어 옵션 -a 

728x90
반응형

'Linux' 카테고리의 다른 글

Linux docker-compose config 수정  (0) 2022.04.06
Linux Docker-compose 설치  (0) 2022.04.06
Linux 계정관리 명령어 모음  (0) 2021.09.26
Window에 Ubuntu 설치  (0) 2021.09.26