블로그 이미지
Rootrator
1개를 알면 모르는 10개가 튀어나온다..!

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Notice

2012. 1. 2. 11:52 Security
서버 보안을 위해 root의 ssh접속을 제한하고 su까지 제한하는 방법을 사용하자.

 
ssh root접속 막는법은 /etc/ssh/sshd_config에서 설정 가능하다.

PermitRootLogin no

 
su사용 그룹으로 wheel을 사용한다.

[root@localhost ~]# grep wheel /etc/group
wheel:x:10:root


CentOS release 4.6 (Final)버전에서는 자동으로 그룹이 생성되어 있었다.


이제 /usr/bin에 권한을 바꿔주자

[root@localhost ~]# chgrp wheel /bin/su
[root@localhost ~]# chmod 4750 /bin/su


SetUID를 통해 su 명령어를 사용시에 root권한을 빌리게 된다.


su사용할 특정 계정을 wheel에 추가해 주자

[root@localhost ~]# usermod -G wheel test_su

위 명령어로 wheel 그룹에 계정이 추가되었을 것이다.
 
[root@localhost ~]# grep wheel /etc/group
wheel:x:10:root,test_su


 
음 그런데 이 계정이 ssh접속이 안되면 안되겠지

/etc/security/access.conf 에 계정을 추가해 주고 ssh접속이 가능케 해주자


그럼 이제 원격접속의 순서는 test_su의 ssh접속 > su - 명령어로 root 접속 

 


 
반응형

'Security' 카테고리의 다른 글

apache 특정 디렉토리에서 php 실행 금지  (0) 2014.12.08
리눅스 웹서버정보 숨기기  (0) 2011.12.13
/tmp 보안설정하기  (2) 2011.09.05
SPF 레코드 확인 방법  (0) 2011.04.14
SSH IP / 계정 차단  (0) 2011.03.24
posted by Rootrator