�͂��߂Ă̎���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�𑀍� >> SSH�T�[�o�̍\�z(OpenSSH)
����m�F�@[ FC1 / FC2 / FC3 / FC4 / FC5 / FC6 / Fedora7 / Fedora8 / Fedora9 / Fedora10 / Fedora11 / Fedora12 / Fedora13 / Fedora14 / Fedora15 / Fedora16 / Fedora17 / CentOS4 / CentOS5 / CentOS6 / CentOS7 ]
  1. OpenSSH�Ƃ́E�E�E
  2. OpenSSH�̃C���X�g�[��
  3. OpenSSH�̐ݒ�
  4. OpenSSH�̍ċN��
  5. SSH2�̌��쐬
  6. �閧���̔������(�T�[�o�ɐڑ�����N���C�A���g�ֈړ�)
    �t���b�s�[�f�B�X�N�ɃR�s�[������@
    FTP�ɂ��l�b�g���[�N�o�R�ŃR�s�[

�� OpenSSH�Ƃ́E�E�E

�T�[�o�𑀍�(�ݒ蓙)����ɓ������āA�T�[�o���g�̃R���\�[���ŕύX����̂��ǂ��ł����A���������̃T�[�o�Ȃ̂ł�����N���C�A���g(���u����)���瑀��o����悤�ɂ��Ă݂܂��傤�I
��ʓI�ɂ�Telnet�ő��삵�܂����ATelnet�͕���(���������̂܂܌����Ă��܂�)�ŒʐM���s���Ă��܂��B
���u�n(����WAN����̑���)����̃��O�C�����A�p�X���[�h���������Ă��܂��Ă͂����Ȃ��̂ŁA�����ł��ʐM���e���Í������ĒʐM���o����SSH���g�p���܂��B
SSH�̐ڑ������ɂ�SSH1��SSH2������SSH2�̕����ASSH1��苭�łȈÍ����ɂȂ��Ă��܂��B
�܂��A�����ł�SSH2���g�p���������ɂ�郍�O�C���݂̂�ڑ��”\�ɂ���ݒ���s���܂��B
���̐ݒ�́A�T�[�o�����J����ɓ�����K���s���Ă����܂��傤�I

�� OpenSSH�̃C���X�g�[��

�C���X�g�[�����Ƀf�t�H���g�ő��݂��܂����A�폜��̈ӓI�ɃC���X�g�[�����Ȃ������ꍇ�͈ȉ��̎菇�ŃC���X�g�[�����ĉ������B
�܂��Aopenssh-clients�́A���Y�[������ʂ�openssh-server�[���ɐڑ�����ꍇ�Ɏg�p���܂��B�K�v�ɉ����ăC���X�g�[�����ĉ������B

openssh-server�̃C���X�g�[��
# yum -y install openssh-server


openssh-clients�̃C���X�g�[��
# yum -y install openssh-clients

�� OpenSSH�̐ݒ�

�ݒ�t�@�C���̕ύX
# vi /etc/ssh/sshd_config

#LoginGraceTime 120
�擪��#���폜���� yes �� no�ɕύX(root(�Ǘ���)�ł̃��O�C�����֎~)
#PermitRootLogin yes
        ��
PermitRootLogin no

# To disable tunneled clear text passwords, change to no here!
�擪��#���폜���� yes �� no�ɕύX(�ʏ�p�X���[�h�̋֎~(�������ɕύX))
#PasswordAuthentication yes
        ��
PasswordAuthentication no
�擪��#���폜(��p�X���[�h�̋֎~)
#PermitEmptyPasswords no
        ��
PermitEmptyPasswords no

�� OpenSSH�̍ċN��

�ݒ�t�@�C����ύX���āA���̒l��L���ɂ���ɂ͍ċN�����s��Ȃ���΂Ȃ�܂���B

OpenSSH�̍ċN��
�yFC1 ���� Fedora15 / CentOS4 / CentOS5 / CentOS6 �̏ꍇ�z
# /etc/rc.d/init.d/sshd restart

�yFedora16�ȍ~ / CentOS7 �̏ꍇ�z
# systemctl start sshd.service

�� SSH2�̌��쐬

�� �����쐬���郆�[�U�[�ɂȂ�

���A�������N�Ȃ̂��\��(����������Ε�����܂����E�E�E)
   ��
[linux@fedora linux]$ whoami
linux                                �� linux ���[�U�[

----- root(�Ǘ���)�����ʃ��[�U�ɂȂ�菇 -----
1 root(�Ǘ���)�����ɂ���ʃ��[�U�ւ̕ύX
linux ���[�U�[�ɂȂ�
[root@fedora root]# su - linux
[linux@fedora linux]$               �� linux ���[�U�[�ɂȂ���

2 ���O�A�E�g�ɂ���ʃ��[�U�[�ւ̕ύX���@
root(�Ǘ���)�̃��O�A�E�g
[root@fedora root]# exit
logout                                �� ���O�A�E�g����
[linux@fedora linux]$               �� linux ���[�U�[�ɖ߂���

-----------------------------------------------------

�� SSH2�ɂ�錮���쐬

���̍쐬
[linux@fedora linux]$ ssh-keygen -t rsa Generating public/private rsa key pair. �������͂��Ȃ��ŃG���^�[�L�[���� Enter file in which to save the key (/home/linux/.ssh/id_rsa): Created directory '/home/linux/.ssh'. �p�X�t���[�Y(SSH2�̃p�X���[�h)���� Enter passphrase (empty for no passphrase): �p�X�t���[�Y�̍ē���(��L�œ��͂�������) Enter same passphrase again: Your identification has been saved in /home/linux/.ssh/id_rsa. Your public key has been saved in /home/linux/.ssh/id_rsa.pub. The key fingerprint is: cc:f6:fe:9b:51:f1:68:fa:61:b4:76:cb:e4:35:99:b8 [email protected] ���̍쐬��̕\�� [linux@fedora linux]$ ls -la /home/linux/.ssh/ ���v 16 drwx------ 2 linux linux 4096 9�E27 14:09 . drwx------ 3 linux linux 4096 9�E27 14:09 .. -rw------- 1 linux linux 951 9�E27 14:09 id_rsa �� �閧�� -rw-r--r-- 1 linux linux 238 9�E27 14:09 id_rsa.pub �� ���J�� ���J����authorized_keys�ɒlj� [linux@fedora linux]$ cat /home/linux/.ssh/id_rsa.pub >> /home/linux/.ssh/authorized_keys ���J���������̂݃A�N�Z�X�ł���悤�ɕύX [linux@fedora linux]$ chmod 600 /home/linux/.ssh/authorized_keys ���J���̍폜 [linux@fedora linux]$ rm -f /home/linux/.ssh/id_rsa.pub ���̍쐬��̕\�� [linux@fedora linux]$ ls -la /home/linux/.ssh/ ���v 16 drwx------ 2 linux linux 4096 9�E27 14:10 . drwx------ 3 linux linux 4096 9�E27 14:09 .. -rw------- 1 linux linux 238 9�E27 14:10 authorized_keys �� ���J�� -rw------- 1 linux linux 951 9�E27 14:09 id_rsa �� �閧�� [linux@fedora linux]$

�� �閧���̔������(�T�[�o�ɐڑ�����N���C�A���g�ֈړ�)

�T�[�o�ɂ��錮���쐬����id_rsa���N���C�A���g����ڑ����邻�̃��[�U�̌��ƂȂ�܂��B
���̌���ڑ�����N���C�A���g�փR�s�[��������@���Љ�܂��B

�� �t���b�s�[�f�B�X�N�ɃR�s�[������@

root(�Ǘ���)�����ōs���Ă�������

�t���b�s�[���}�E���g
# mount /mnt/floppy/
�閧�����t���b�s�[�Ɉړ�
# mv /home/linux/.ssh/id_rsa /mnt/floppy/
�t���b�s�[�̃}�E���g������
# umount /mnt/floppy/

�� FTP�ɂ��l�b�g���[�N�o�R�ŃR�s�[

1. FTP�T�[�r�X���N������

�ꎞ�I��FTP�T�[�o���C���X�g�[������
# yum -y install vsftpd

FTP�T�[�o���N��
�yFC1 ���� Fedora15 / CentOS4 / CentOS5 / CentOS6 �̏ꍇ�z
# /etc/rc.d/init.d/vsftpd start

�yFedora16�ȍ~ / CentOS7 �̏ꍇ�z
# systemctl start vsftpd.service

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

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

���[�J���̃J�����g��C:\�ɂ��Ă���
C:\Documents and Settings\client>cd \
C:\>                                             �� ���[�J����C:\�ɂȂ���
FTP�ŃT�[�o�ɐڑ�����
C:\>ftp 192.168.1.5
Connected to 192.168.1.5.
220 (vsFTPd 1.2.1)
���[�U�������
User (192.168.1.5:(none)): linux
331 Please specify the password.
�p�X���[�h�����
Password:
230 Login successful.
�]�����[�h���o�C�i�����[�h�ɂ���
ftp> bin
200 Switching to Binary mode.
�閧�����擾
ftp> get /home/linux/.ssh/id_rsa
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for /home/linux/.ssh/id_rsa (951
bytes).
226 File send OK.                                �� �]������������
ftp: 951 bytes received in 0.00Seconds 951000.00Kbytes/sec.
�T�[�o�̔閧�����폜
ftp> delete /home/linux/.ssh/id_rsa
250 Delete operation successful.                 �� �폜����������
FTP�ڑ����I��
ftp> bye
221 Goodbye.
C:\>
���[�J���̊m�F
C:\>dir
�h���C�u C �̃{�����[�� ���x��������܂���B
�{�����[�� �V���A���ԍ��� 649A-F32D �ł�

C:\ �̃f�B���N�g��

2004/09/02  14:34                 0 AUTOEXEC.BAT
2004/09/02  14:34                 0 CONFIG.SYS
2004/09/02  14:48    <DIR>          Documents and Settings
2004/09/23  10:16               951 id_rsa        �� �R�s�[�������
2004/09/22  10:02    <DIR>          Program Files
2004/09/06  11:58    <DIR>          WINDOWS
               3 �‚̃t�@�C��                 951 �o�C�g
               3 �‚̃f�B���N�g��   5,651,943,424 �o�C�g�̋󂫗̈�

DOS���I��
C:\>exit

3. FTP�T�[�o�̏I��

FTP�T�[�o�̏I��
�yFC1 ���� Fedora15 / CentOS4 / CentOS5 / CentOS6 �̏ꍇ�z
# /etc/rc.d/init.d/vsftpd stop

�yFedora16�ȍ~ / CentOS7 �̏ꍇ�z
# systemctl stop vsftpd.service

4. FTP�T�[�o�̃A���C���X�g�[��

FTP�T�[�o�̃A���C���X�g�[��
# yum -y remove vsftpd


���l)�A���C���X�g�[�����Ȃ��Ă��T�[�r�X���~�߂邾���ł��\��Ȃ��B
�yFC1 ���� Fedora15 / CentOS4 / CentOS5 / CentOS6 �̏ꍇ�z
FTP�T�[�r�X�̎����N����~
# chkconfig vsftpd off
FTP�T�[�r�X�̎����N���m�F
# chkconfig --list vsftpd
vsftpd          0:�I�t  1:�I�t  2:�I�t  3:�I�t  4:�I�t  5:�I�t  6:�I�t

�yFedora16�ȍ~ / CentOS7 �̏ꍇ�z
FTP�T�[�r�X�̎����N����~
# systemctl disable vsftpd.service
FTP�T�[�r�X�̎����N���m�F
# systemctl status vsftpd.service
vsftpd.service - Vsftpd ftp daemon
          Loaded: loaded (/lib/systemd/system/vsftpd.service; disabled)
          Active: inactive (dead)
          CGroup: name=systemd:/system/vsftpd.service

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

�� ���̑�

�y�[�W�擪��

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