2011-08-17 3 views
1

A, B, C, D 등 여러 사용자가 있고 두 그룹 : 마스터, 슬레이브가 있습니다. 각 사용자는이 그룹 중 하나 (독점적으로)에만 속합니다. 이 소속을 프로그래밍 방식으로 어떻게 변경할 수 있습니까?리눅스에서 그룹화 할 사용자 소속을 변경하는 방법

예 : 사용자 A가 "master"그룹에 속합니다. "master"그룹에서 제거하고 "slave"그룹에 추가하는 방법은 무엇입니까? usermod의 사람 페이지에서

답변

1

:이 시스템에 사전 설치되어 있지 않은 몇 가지 이유가 pwdutils 패키지의 명령 인 경우

-G, --groups group,... 
With this option a list of supplementary groups can be specified, which the user should become a member of. Each group is separated from the next one only by a comma, without whitespace. The user is removed from all other groups not specified. 


-R, --remove-from-group group,... 
With this option a list of groups can be specified, from which the user should be removed. Each group is separated from the next one only by a comma, without whitespace. 

.

관련 문제