[보안][네트워크] redhat 6.x 에서 rlogin,rsh 사용법 (아랑)

rsh,rlogin 사용방법입니다. 참고하세요..

redhat 6.x 에서 초기 설정 방법

1. /etc/inetd.conf 파일 설정

/etc/inetd.conf 파일을 여시고 shell,login 에 관련된 항목의 # 표시를 제거해 주세요.

————————————————————————-

——-

shell   stream  tcp     nowait  root    /usr/sbin/tcpd  in.rshd

login   stream  tcp     nowait  root    /usr/sbin/tcpd  in.rlogind

#exec   stream  tcp     nowait  root    /usr/sbin/tcpd  in.rexecd

#comsat dgram   udp     wait    root    /usr/sbin/tcpd  in.comsat

#talk   dgram   udp     wait    nobody.tty      /usr/sbin/tcpd  in.talkd

#ntalk  dgram   udp     wait    nobody.tty      /usr/sbin/tcpd  in.ntalkd

redhat 7.x 에서 초기 설정 방법

/etc/xinetd.d 디렉토리 안에 shell,login 항목이 있는지 확인한다. 기본적으로

초기에 보안처리를 안해놓았으면..있기 마련이다. 이 항목의 설정값을 수정한다.

# vi login

————————————————————————-

—

service login

{

        socket_type             = stream

        protocol                = tcp

        wait                    = no

        user                    = root

        server                  = in.rlogind

        disable                 = yes     -> 이항목을 yes 에서 no

}

————————————————————————-

—

# vi shell

————————————————————————-

—

service shell

{

        socket_type             = stream

        protocol                = tcp

        wait                    = no

        user                    = root

        server                  = in.rshd

        disable                 = yes     -> 이항목을 yes 에서 no

}

만일 누군가 제대로된 관리자가 있어 이미 보안 처리가 되었다면….

먼저 /etc/inetd.conf 파일을 만든다. 여기 내용에

shell   stream  tcp     nowait  root    /usr/sbin/tcpd  in.rshd

login   stream  tcp     nowait  root    /usr/sbin/tcpd  in.rlogind

두항목을 넣는다. 그런뒤…다음 명령어를 입력한다.

# inetdconvert -d /etc/xinetd.d shell

# inetdconvert -d /etc/xinetd.d login

2. /etc/hosts 파일 설정

/etc/hosts 파일을 여시고 안에..각 노드등의 host 정보를 아래와 같이 적어주세요.

# vi /etc/hosts

————————————————————————-

——-

192.168.0.1                node1.clunix.com        node1

192.168.0.2                node2.clunix.com        node2

192.168.0.3                node3.clunix.com        node3

192.168.0.4                node4.clunix.com        node4

192.168.0.5                node5.clunix.com        node5

192.168.0.6                node6.clunix.com        node6

192.168.0.7                node7.clunix.com        node7

192.168.0.8                node8.clunix.com        node8

————————————————————————-

——-

3. 각 Client 설정방법

$HOMEDIR/.rhosts, /etc/hosts.equiv

사용자들이 하고싶어 하는 것중의 하나는 패스워드없이 노드간에 접속을 하고 원격명령

을

내리는 것이다.

대부분의 Beowulf 소프트웨어와 유틸리티들은 여러분이 rsh로 작동하게 만들어 패스워

드

없이 작업하게 만든다.

클러스터내의 패스워드를 없애는 두가지 방법이 있는데 하나는 /etc/hosts.equiv에 입

력하는

것이고, 다른 하나는 사용자 각자의 디렉토리에 .rhosts를 첨가하는 것이다.

/etc/hosts.equiv가 모든 노드에 .rhosts에 있는 내용을 모아서 하나의 파일로 적용될

수

있기에 많이 선호된다.

다음의 형태는 .rhosts에 있는 호스트의 목록이다:

————————————————————————-

——-

# must be read/writable by user only!

node1

node2

node3

node4

node5

node6

————————————————————————-

——-

/etc/hosts.equiv의 형태는:

————————————————————————-

——-

#node name      optional user name

node1                root        

node2                root

node3                root

node4                root

node5                root

node6                root

————————————————————————-

——-

root rlogin 접근:

root가 클러스터내의 어떠한 노드에도 rlogin하기 위해서는 각노드의 /root 디렉토리에

.rhosts를 첨가해야합니다. .rhosts파일은 클러스터내의 모든 노드들을 명기하고 있어야

합니다.

중요한점: .rhosts는 반드시 사용자만이 읽고 쓸 수 있어야합니다. ( chmod go-

rwx .rhosts)

이는 게이트웨이 노드(외부와 연결된 노드)에서는 해서는 안됩니다.

추가로 /etc/pam.d/rlogin:의 처음 두줄을 바꿔줍니다.

————————————————————————-

——-

#orginal /etc/pam.d/rlogin

auth     required       /lib/security/pam_securetty.so

auth     sufficient     /lib/security/pam_rhosts_auth.so

auth     required       /lib/security/pam_pwdb.so shadow nullock

auth     required       /lib/security/pam_nologin.so

account  required       /lib/security/pam_pwdb.so

password required       /lib/security/pam_cracklib.so

password required       /lib/security/pam_pwdb.so shadow nullock

                                                   use_authtok

session  required       /lib/security/pam_pwdb.so

#first two lines are swapped /etc/pam.d/rlogin

auth     sufficient     /lib/security/pam_rhosts_auth.so

auth     required       /lib/security/pam_securetty.so

auth     required       /lib/security/pam_pwdb.so shadow nullock

auth     required       /lib/security/pam_nologin.so

account  required       /lib/security/pam_pwdb.so

password required       /lib/security/pam_cracklib.so

password required       /lib/security/pam_pwdb.so shadow nullock

                                                   use_authtok

session  required       /lib/security/pam_pwdb.so

————————————————————————-

——-

NOTE: 더 나은 방법이 있는지는 모르겠지만 작동은 한다.

root telnet 접근

게이트웨이 노드를 제외한 모든 노드에 /etc/securetty 파일에 다음과 같은 내용을 첨가

한다:

————————————————————————-

——-

ttyp0

ttyp1

ttyp2

ttyp3

ttyp4

————————————————————————-

——-

이러한 변화는 remote telnet을 이용 클러스터내의 어떠한 노드로 연결 이 가능케하는 것

이다.

root ftp 접근

root의 ftp 접근이 필요한 시스템의 경우, /etc/ftpusers 파일에 다음과 같이 root 부분에

주석을 단다.

————————————————————————-

——-

#Comment out root to allow other systems ftp access as root

#root

bin

daemon

adm

lp

sync

shutdown

halt

mail

news

uucp

operator

games

nobody

서진우

슈퍼컴퓨팅 전문 기업 클루닉스/ 상무(기술이사)/ 정보시스템감리사/ 시스존 블로그 운영자

You may also like...

페이스북/트위트/구글 계정으로 댓글 가능합니다.