Linux/Debian에서 포트 7(에코 포트) 열기

Linux/Debian에서 포트 7(에코 포트) 열기

디버깅 목적으로 Linux/Debian에 에코 서버가 필요합니다. 이미 해당 작업을 수행하기 위해 '/etc/services'에 표시된 할당된 포트가 있고 포트 7 TCP/UDP라는 것을 깨달았습니다.

Linux(Debian)에서 이 포트를 열 수 있습니까? 그렇지 않다면 대안은 무엇입니까?

답변1

Debian에서 에코 서비스를 설정하려면 다음을 xinetd사용하여 설치할 수 있습니다.

apt-get install xinetd

지시문을 in disable으로 변경해야 합니다 . 또는 파일이 존재하지 않는 경우 다음과 같이 생성합니다.no/etc/xinetd.d/echo

# default: off
# description: An xinetd internal service which echo's characters back to
# clients.
# This is the tcp version.
service echo
{
    disable     = no
    type        = INTERNAL
    id      = echo-stream
    socket_type = stream
    protocol    = tcp
    user        = root
    wait        = no
}

# This is the udp version.
service echo
{
    disable     = yes
    type        = INTERNAL
    id      = echo-dgram
    socket_type = dgram
    protocol    = udp
    user        = root
    wait        = yes
}

disable = no파일을 설정하거나 생성한 후 다음을 xinetd사용하여 다시 시작합니다.

sudo service xinetd restart

TCP 서비스 를 테스트하려면 echo:

$nc localhost echo
testing...
testing...
xxxx
xxxx
^C

관련 정보