레이블이 su 명령어 특정 계정에서만 작동인 게시물을 표시합니다. 모든 게시물 표시
레이블이 su 명령어 특정 계정에서만 작동인 게시물을 표시합니다. 모든 게시물 표시

2007년 3월 13일 화요일

특정 ID만 su명령어 먹히게 하기

새로 설치한 나의 fedora 6 머신을 예제로 함

# vi /etc/group

wheel:x:10:root,superkjh


wheel 부분에 su 명령을 사용하게 할 계정을 추가한다. 또는

# usermod -G wheel superkjh


이라는 명령으로 superkjh이라는 계정을 wheel 그룹에 포함 시킬 수 있다.

이제 /etc/pam.d/su 파일을 편집한다.
use_uid를 debug group=wheel로 바꾸었다.

#%PAM-1.0
auth            sufficient      pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth           sufficient      pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
#auth           required        pam_wheel.so use_uid
auth           required        pam_wheel.so debug group=wheel
auth            include         system-auth
account         sufficient      pam_succeed_if.so uid = 0 use_uid quiet
account         include         system-auth
password        include         system-auth
session         include         system-auth
session         optional        pam_xauth.so

다른 계정도 하나 추가하여 로긴여부를 테스트 해본다.