본문 바로가기

Infra/리눅스 서버

[리눅스 서버] 서버 보안 가이드 - 'r' commands 서비스 제거

[리눅스 서버] 서버 보안 가이드 - 'r' commands 서비스 제거

 

 

취약점 구분 : 네트워크 서비스

 

■ 취약점 항목 : 'r' Commands 서비스 제거

 

■ 대상 OS : Linux

 

■ 위험도 : 상

 

■ 방법 : 특별한 목적으로 사용하지 않는 'r' commands 서비스 제거

 

■ 내용

    - rsh, rlogin, rexec 등의 'r' commands는 인증 없이 관리자의 원격접속이 가능하게 하는 명령어들로, 보안상 매우 취약하여 서비스 포트가 열려있으면 침해사고의 위험성이 있음.

    - 따라서, NET Backup 등 특별한 용도로 사용하지 않는다면 rsh, rlogin, rexec 과 같은 'r' commands 서비스 제거

 

■ 조치방법

    <'r' command 서비스 필요 시>

    - /etc/hosts.equiv 파일과 $HOME/rhosts 파일 내 호스트 및 계정부분에서 "+"를 반드시 제거하고, 아래 예시처럼 필요한 호스트 및 계정만 등록

    - "etc/hosts.equiv", "$HOME/.rhosts" 파일의 권한과 소유 지정

 

 예)

  # vi /etc/hosts.equiv (or $HOME/.rhosts)

     Mooky security

 

  # chown root /etc/hosts.equiv

  # chmod 400 /etc/hosts.equiv

  # chown root /root/.rhosts

  # chmod 400 /root/.rhosts 

 

      ※ Symbolic Link 를 사용을 권장하며, 퍼미션 변경은 필요 없음.

          cron 에 넣어서 주기적으로 관리하는 것과 "/etc/hosts.equiv"파일은 아래와 같이 설정하는 것을 권장

          # /bin/touch /.netrc /etc/hosts.equiv

          # /bin/chmod 400 /.netrc /etc/hosts.equiv

 

    <'r' command 서비스 불필요 시>

    - 서비스 제거하고 /etc/hosts.equiv, /$HOME/.rhosts 파일 권한 변경

    - 서비스 제거 예시

      ▶ "/etc/xinetd.d" 디렉토리 내의 서비스 파일 수정

      ▶ "xinetd.d" 디렉토리 내에서 필요없는 서비스들을 Disable

 

 /etc/xinetd.d/rstatd 파일

 service rstatd

 {

         disable            = yes

         socket_type      = stream

         wait                = no

         … 생략

 }

      # service xinetd restart





※ 문의 사항은 메일 : jyuhm@sntkor.com 이나 070-8611-4853


문의 사항 남기기