2013년 12월 2일 월요일

[Linux] su 명령 제한하기

일반사용자들이 수퍼유저계정으로 변경을 하려면 su라는 명령어를 쓰게된다. 만약 su명령을 몇몇 사람들에게만 쓸수 있게 하려한다면 다음과 같이하면 된다.

]# vi /etc/pam.d/su
#%PAM-1.0
auth       sufficient   /lib/security/pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth       sufficient   /lib/security/pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
#auth       required     /lib/security/pam_wheel.so use_uid                => 주석을 제거한다.
auth       required     /lib/security/pam_stack.so service=system-auth
account    required     /lib/security/pam_stack.so service=system-auth
password   required     /lib/security/pam_stack.so service=system-auth
session    required     /lib/security/pam_stack.so service=system-auth
session    optional     /lib/security/pam_xauth.so

위 설정은 wheel 그룹에 속한 사용자들만이 su 명령을 쓸수 있다는 것을 말한다. wheel은 이러한 목적으로 사용될 수 있는 특별한 계정이다. 따라서 wheel 이외의 그룹은 위와같이 사용될 수없다.

위 설정에서 wheel 그룹에 속한 사람만이 su 명령을 사용할 수있게 했으므로 su 명령을 써야하는 계정이 있다면 wheel 그룹에 추가시켜 주어야한다. 만약 in4mania 라는 계정을 wheel 그룹으로 추가하려면 다음과 같이한다.

다음 명령에서 G는 그룹을 나타내며, 10은 wheel 에 해당하는 값이다.

# usermod -G10 in4mania

Reentrancy Attack: 블록체인 스마트 컨트랙트의 치명적인 취약점

블록체인 기술이 전 세계적으로 주목받으면서 스마트 컨트랙트(Smart Contract)의 사용이 급격히 증가하고 있습니다. 하지만 그만큼 보안 취약점도 함께 늘어나고 있는데, 그 중에서도 Reentrancy Attack(재진입 공격)은 매우 치명적이고...