�͂��߂Ă̎���T�[�o�\�z - Fedora/CentOS -
Last Update 2018/05/30
[ �X�V���� ] [ �T�C�g �}�b�v ] [ ����f���� ] [ �G�k�f���� ] [ �����N ]
�� �g�b�v >> �N���C�A���g���T�[�o�𑀍� >> Telnet�T�[�o�̍\�z(Telnet)
����m�F�@[ FC1 / FC2 / FC3 / FC4 / FC5 / FC6 / Fedora7 / Fedora8 / Fedora9 / Fedora10 / Fedora11 / Fedora12 / Fedora13 / Fedora14 / Fedora15 / Fedora16 / Fedora17 / CentOS4 / CentOS5 / CentOS6 / CentOS7 ]
  1. �͂��߂ɁE�E�E
  2. Telnet�T�[�o�̃C���X�g�[��
  3. Telnet���O�C���ł���N���C�A���g�̐���(�Z�L�����e�B����)
  4. Telnet-Server�̗L�����ƋN��
  5. Telnet�̓���m�F
  6. root��telnet���O�C�����”\�ɂ���
    PAM�𖳌��ɂ���ꍇ
    PAM��ʂ��ă��O�C������ꍇ
  7. �O��(WAN)����̐ڑ�

�� �͂��߂ɁE�E�E

�^�[�~�i���c�[���Ƃ��Ă�telnet���L���ł����A���l�I�ɂ͂��܂肨���߂ł��܂���B ���R�Ƃ��ẮA�ȉ��̓_���������܂��B

�ł͉��́A�Љ�邩�Ɛ\���܂��ƊǗ��҂ւ̏Љ�v�]�����ɑ��������_�ł��B
�\�z�Љ�͒v���܂����ALAN�ȊO(WAN)����̃T�[�o�A�N�Z�X�ɂ͏\���ɋC��t���ĉ������B

�l�I�ɂ́wPuTTY �ɂ��T�[�o�����[�g�ڑ��x�������߂��܂��B

�� Telnet�T�[�o�̃C���X�g�[��

# yum -y install telnet-server

�� Telnet���O�C���ł���N���C�A���g�̐���(�Z�L�����e�B����)

Telnet���O�C���ł���N���C�A���g��ݒ�
# vi /etc/hosts.allow
#
# hosts.allow   This file describes the names of the hosts which are
#       allowed to use the local INET services, as decided
#       by the '/usr/sbin/tcpd' server.
#
�v���C�x�[�g�A�h���X�u192.168.1.�v�ƃT�[�o���g�A�O���[�o���A�h���X�u211.xxx.xxx.xxx�v�͋���
in.telnetd : 192.168.1. 127.0.0.1 211.xxx.xxx.xxx


�w/etc/hosts.allow�x�Ŏw�肳�ꂽ�N���C�A���g�ȊO�͑S�ċ���
# vi /etc/hosts.deny
#
# hosts.deny    This file describes the names of the hosts which are
#       *not* allowed to use the local INET services, as decided
#       by the '/usr/sbin/tcpd' server.
#
# The portmap line is redundant, but it is left to remind you that
# the new secure portmap uses hosts.deny and hosts.allow.  In particular
# you should know that NFS uses portmap!
in.telnetd : ALL

�� Telnet-Server�̗L�����ƋN��

�C���X�g�[������ł́ATelnet-Server�͖����ɂȂ��Ă��܂��B�ȉ��̕ύX�������鎖�ŗL���ɂł��܂��B

Telnet-Server�̗L����
�ySysV services �̏ꍇ(FC1 ���� Fedora15 / CentOS4 / CentOS5 / CentOS6)�z
# 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.telnetd
    log_on_failure  += USERID
    disable     = no
}
xinetd���ċN��
# /etc/init.d/xinetd restart

�ysystemd services �̏ꍇ(Fedora16�ȍ~ / CentOS7)�z
# systemctl start telnet.socket

�� Telnet�̓���m�F

�N���C�A���g�@���ڑ�����(������Windows��DOS�����s���Ă�������)

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

telnet�̋N��
C:\Documents and Settings\fedora>telnet

Microsoft Telnet �N���C�A���g�ւ悤����

�G�X�P�[�v������ 'CTRL+]' �ł�

Microsoft Telnet> op 192.168.1.5
�ڑ���: 192.168.1.5...


Fedora Core release 2 (Tettnang)
Kernel 2.6.8-1.521 on an i686
login: linux
Password:
Last login: Mon Dec  6 17:58:45 from 192.168.1.10
telnet�o�R�ł̃��O�C�����ł���
[linux@fedora linux]$

�� root��telnet���O�C�����”\�ɂ���

�� PAM�𖳌��ɂ���ꍇ (Fedora8 �ȍ~�s�B�ȉ��́w�� PAM��ʂ��ă��O�C������ꍇ�x�Q��)

�Z�L�����e�B�̕ύX
# vi /etc/pam.d/login
#%PAM-1.0
�ȉ��̍s���R�����g�܂��͍폜����
#auth       required     pam_securetty.so
auth       required     pam_stack.so service=system-auth
auth       required     pam_nologin.so
account    required     pam_stack.so service=system-auth
password   required     pam_stack.so service=system-auth
session    required     pam_selinux.so multiple
session    required     pam_stack.so service=system-auth
session    optional     pam_console.so

�ݒ�ύX��L���ɂ���ׁA�ċN������
# reboot

�ċN����A�N���C�A���g�����root(�Ǘ���)�ł�telnet���O�C�����”\�ɂȂ�܂�

�� PAM��ʂ��ă��O�C������ꍇ

PAM�̃��O�C���T�����������ȒP�ɐ�������ƁA���O�C���v����PAM�ɂ�錟�؁����O�C��(��/�s��)�ƂȂ�܂��B
���̎��A���O�C�����i��PAM�́u/etc/pam.d/login�v�ƂȂ��Ă��܂��B
���̒��́upam_securetty.so�v�́Aroot�����O�C���Ń��O�C���v�����Ă����[����񂪁u/etc/securetty�v�t�@�C�����Ɉ�v���Ă����ꍇ�͌㑱�̃`�F�b�N�Ɉڂ��Ă����܂����A�Ȃ��ꍇ�̓��O�C���v�������ۂ���Ă��܂��Aroot�ł̃��O�C�����s�”\�ƂȂ��ł��B

�u/etc/securetty�v�̓��e
# cat /etc/securetty
console
vc/1
vc/2
vc/3
vc/4
vc/5
vc/6
vc/7
vc/8
vc/9
vc/10
vc/11
tty1
tty2
tty3
tty4
tty5
tty6
tty7
tty8
tty9
tty10
tty11

�܂��A�O�����Ƃ��ăR���\�[����܂��͈�ʃ��[�U�ň�x���O�C����Aroot�ɂȂ�܂��B
���̌�A�uTeraTerm�v�Ȃǂ̃^�[�~�i���\�t�g�Ń��O�C����ʂ��N�����ĉ������B(�ȉ��̃��O�C����ʂ̏��)

Fedora release 8 (Werewolf)
Kernel 2.6.23.1-49.fc8 on an i686
login:

��L�̏�Ԓ��ɁA�O������root�ɂȂ��Ă����ʂ��ȉ������s���܂��B

���s���v���Z�X�̕\��(�ȉ��͔������Ă��܂��B)
# ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root      1574     1  0 15:58 ?        00:00:00 xinetd -stayalive -pidfile /var/
root      1753  1574  0 16:00 ?        00:00:00 in.telnetd: 192.168.1.100
root      1754  1753  0 16:00 pts/0    00:00:00 /bin/login -h 192.168.1.100 -p


1�Ԗڂ��uxinetd�v�Łutelnet�v�Ȃǂ̃X�[�p�[�f�[�������i���Ă���e�v���Z�X�ɂȂ�APID(���s�v���Z�X�ԍ�)�́u1574�v�ƂȂ��Ă��܂��B(�ȉ�)
root      1574     1  0 15:58 ?        00:00:00 xinetd -stayalive -pidfile /var/

2�Ԗڂ��utelnet�v�v���Z�X�Őe�̃v���Z�X(PPID)�u1574�v���PID���u1753�v�Ŏ��s����Ă��܂��B(�ȉ�)
root      1753  1574  0 16:00 ?        00:00:00 in.telnetd: 192.168.1.100

3�Ԗڂ��ulogin�v�v���Z�X�Őe�̃v���Z�X(PPID)�u1753�v���PID���u1754�v�Ŏ��s����ATTY���upts/0�v�ƂȂ��Ă��܂�(�ȉ�)
root      1754  1753  0 16:00 pts/0    00:00:00 /bin/login -h 192.168.1.100 -p

��L�́upts/0�v���A��قǂ́u/etc/securetty�v�ɒlj����Ă�����΁Aroot�ł̃��O�C�����”\�ƂȂ�܂��B


�[������lj�
# vi /etc/securetty
�@�@�@�@�F
�@�@�@�@�F
�@�@�@�@�F
�ŏI�s�ɒlj�����
pts/0
pts/1
pts/2
pts/3
pts/4
pts/5
pts/6
pts/7
pts/8
pts/9
pts/10
pts/11

���F�ԍ��͊��ɓo�^���Ă���utty�v�Ɠ����������ݒ肷��΂悢�ł��傤�B

�� �O��(WAN)����̐ڑ�

WAN����ڑ�����ɓ������āA���[�^�̐ݒ肪�K�v�ł��B
���[�^�̃|�[�g�J�‚́A�������̃��[�^�戵���������������������B

DNS���Őڑ�����ɂ͎��O�Ƀh���C�����̎擾���s���Ă���K�v������܂��B(�ȉ��͑�\�I�Ȃ��̂ł���A�܂��A���T�C�g���g�p�����Ē����Ă���܂�)

�� �R���e���c�֘A

�� ���̑�

�y�[�W�擪��

Copyright(©)2004-2018 First home server construction. All Right Reserved.