アプリ版:「スタンプのみでお礼する」機能のリリースについて

以下にCentOS6.6でtelnetServerを
構築した手順を記載します。

自分自身にすらtelnetできません。。。
なぜでしょう?

設定に間違いがあるのでしょうか?
参考にしたサイトは、
http://futurismo.biz/archives/1339
http://easyramble.com/install-telnet-and-setup.h …
http://www.sea-bird.org/pukiwiki/index.php?CentO …
などです。


(1)telnetクライアントインストール
[root@localhost ~]# yum -y install telnet

(2)telnetサーバーインストール
[root@localhost ~]# yum -y install telnet-server

(3)telnetを許可設定
[root@localhost ~]# vi /etc/hosts.allow

# hosts.allow This file contains access rules which are used to
in.telnetd : 192.168.1. 127.0.0.1 #192.168.223.0のネットワークと自分自身OK


(4)telnet不許可設定
[root@localhost ~]# vi /etc/hosts.deny
# hosts.deny This file contains access rules which are used to
in.telnetd : ALL #追記

(5)
vi /etc/xinetd.d/telnet
# default: on
# description: The telnet server serves telnet sessions; it uses \
# unencrypted username/password pairs for authentication.
service telnet
{
flags = REUSE-
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.log_on_failure += USERID
disable = no # ここをyesからnoに変更
}

(6)xinitdを再起動する
[root@localhost ~]# /etc/init.d/xinetd restart
xinetd を停止中: [失敗]
xinetd を起動中: [ OK ]

(7)自分自身にtelnet
[root@localhost ~]# telnet localhost
Trying ::1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.

接続できない!!

23番ポートを解放してみる。
[root@localhost ~]# vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
-A INPUT -m state --state NEW -m tcp -p tcp --dport 23 -j ACCEPT #追加しました。
COMMIT

iptablesを再起動
[root@localhost ~]# service iptables restart

もう一度自分自信にtelnetしてみるが接続できず!!
[root@localhost ~]# telnet localhost
Trying ::1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.

なぜでしょう??

どなたかご教授下さい。

A 回答 (3件)

こちらも参考にしてみては。


http://detail.chiebukuro.yahoo.co.jp/qa/question …
    • good
    • 1

マルチポストもほどほどにしないと誰も回答してくれなくなりますよ?


どうせ誰かが回答するだろう。と…。
# で、この指摘は事務局削除の対象でしょうなぁ…。


んで、本題。

>(6)xinitdを再起動する
>[root@localhost ~]# /etc/init.d/xinetd restart
>xinetd を停止中: [失敗]
>xinetd を起動中: [ OK ]

の後、netstatでxinetdが設定したポートで待ち受けしているか確認した方がいいでしょう。


>(7)自分自身にtelnet
>[root@localhost ~]# telnet localhost
>Trying ::1...
>Connected to localhost.

接続しようとしたのは「::1」でIPv6の方となります。
ので…

>23番ポートを解放してみる。
>[root@localhost ~]# vi /etc/sysconfig/iptables

対象ファイルが違います。
/etc/sysconfig/ip6tables
があったハズです。

もちろん、適用させる場合の
>iptablesを再起動
>[root@localhost ~]# service iptables restart
も ip6tables になります。


私自身の管理下のCentOSではIPv6を無効にするようにしましたけどね。
# /etc/sysctl.confのnet.ipv6.conf.all.disable_ipv6とnet.ipv6.conf.default.disable_ipv6に1を指定して、
# /etc/hostsのIPv6対応部分をコメントアウトして、
# /etc/netconfigのtcp6とudp6をコメントアウトして、
# /etc/modprobe.d/disable-ipv6.confにoptions ipv6 disable=1を追加して…リブートだったか??
# もちろんIPv6無効にしたのでchkconfig ip6tables offで自動起動も無効。


そんなワケで…
/etc/xinetd.d/telnetのflagsにIPv4を追加して、xinetdがIPv6で待ち受けしないように修正してます。
# flagsに入れないと無理矢理IPv6側で待ち受けしていた…かなぁ???
    • good
    • 0

なぜsshではなくtelnetが必要なのでしょうか?


もし後学のためだとしても、telnetを現場で使うことはほぼないと思いますし
設定するメリットはないと思いますが・・・
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!