Linux/Debian でポート 7 (エコー ポート) を開く

Linux/Debian でポート 7 (エコー ポート) を開く

デバッグのために Linux/Debian にエコー サーバーが必要なのですが、そのために割り当てられたポートがすでに '/etc/services' に表示されており、そのポートは TCP/UDP の 7 番ポートであることに気付きました。

Linux (Debian) でこのポートを開くことは可能ですか? できない場合、代替手段は何ですか?

答え1

Debian で echo サービスを設定するには、次のxinetdコマンドでインストールできます。

apt-get install xinetd

次に、ディレクティブを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

関連情報