Linux

[Micro Server G7 N54L] su 명령어 제한

은총애비!! 2014. 9. 19. 00:14
반응형

[Micro Server G7 N54L] su 명령어 제한

 

su 명령을 사용할 수 있는 계정을 정해서 그 계정만 su 명령을 사용 할 수 있도록 제한

 

모든 사용자는 su 명령으로 root 권한으로 변경 할 수 있습니다.

이러한 최고 권한 root로 가는 것을 제한 하는 방법 입니다.

 

vi /etc/pam.d/su 파일에 2줄 추가합니다.

auth        sufficient        /lib/security/$ISA/pam_rootok.so

auth        sufficient        /lib/security/$ISA/pam_wheel.so group=sugroup

#%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            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

 

group=sugroup 에 group에 sugroup에 포함된 사용자만 su 명령을 수행 할 수 있습니다.

그외 사용자는 아래와 같이 su 명령에 정상적인 암호를 넣어도 제한 됩니다.

bash-4.0$ su
암호:
su: incorrect password
bash-4.0$


 

반응형