| はじめての自宅サーバ構築 - Fedora/CentOS - | Last Update | 2008/05/16 | |
| It opened to 2004/09/19. 当サイトはFedora9で運用しています |
Visitors Pageviews Today(IP/PV) |
3,251,335 12,001,952 1,804/10,609 |
|
デルではおとくなキャンペーン実施中! |
レノボ Web 広告限定ストア(キャンペーン&新着情報) |
openssh-serverのインストール # yum -y install openssh-server openssh-clientsのインストール # yum -y install openssh-clients |
設定ファイルの変更
# vi /etc/ssh/sshd_config
#LoginGraceTime 120
先頭の#を削除して yes を noに変更(root(管理者)でのログインを禁止)
#PermitRootLogin yes
↓
PermitRootLogin no
# To disable tunneled clear text passwords, change to no here!
先頭の#を削除して yes を noに変更(通常パスワードの禁止(鍵方式に変更))
#PasswordAuthentication yes
↓
PasswordAuthentication no
先頭の#を削除(空パスワードの禁止)
#PermitEmptyPasswords no
↓
PermitEmptyPasswords no
|
OpenSSHの再起動 # /etc/rc.d/init.d/sshd restart sshdを停止中: [ OK ] sshdを起動中: [ OK ] |
今、自分が誰なのか表示(ここを見れば分かりますが・・・) ↓ [linux@fedora linux]$ whoami linux ← linux ユーザー ----- root(管理者)から一般ユーザになる手順 ----- 1 root(管理者)権限による一般ユーザへの変更 linux ユーザーになる [root@fedora root]# su - linux [linux@fedora linux]$ ← linux ユーザーになった 2 ログアウトによる一般ユーザーへの変更方法 root(管理者)のログアウト [root@fedora root]# exit logout ← ログアウトした [linux@fedora linux]$ ← linux ユーザーに戻った ----------------------------------------------------- |
鍵の作成 |
root(管理者)権限で行ってください フロッピーをマウント # mount /mnt/floppy/ 秘密鍵をフロッピーに移動 # mv /home/linux/.ssh/id_rsa /mnt/floppy/ フロッピーのマウントを解除 # umount /mnt/floppy/ |
一時的にFTPサーバをインストールする # yum -y install vsftpd Gathering header information file(s) from server(s) Server: Fedora Core 2 - i386 - Base Server: Fedora Legacy utilities for Fedora Core 2 Server: Fedora Core 2 - i386 - Released Updates Finding updated packages Downloading needed headers Resolving dependencies .Dependencies resolved I will do the following: [install: vsftpd 1.2.1-5.i386] I will install/upgrade these to satisfy the dependencies: [deps: libcap 1.10-18.1.i386] Downloading Packages Getting vsftpd-1.2.1-5.i386.rpm vsftpd-1.2.1-5.i386.rpm 100% |=========================| 94 kB 00:00 Getting libcap-1.10-18.1.i386.rpm libcap-1.10-18.1.i386.rpm 100% |=========================| 15 kB 00:00 Running test transaction: Test transaction complete, Success! libcap 100 % done 1/2 vsftpd 100 % done 2/2 Installed: vsftpd 1.2.1-5.i386 Dep Installed: libcap 1.10-18.1.i386 Transaction(s) Complete FTPサーバを起動 # /etc/rc.d/init.d/vsftpd start vsftpd用のvsftpdを起動中: [ OK ] |
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
ローカルのカレントをC:\にしておく
C:\Documents and Settings\client>cd \
C:\> ← ローカルがC:\になった
FTPでサーバに接続する
C:\>ftp 192.168.1.5
Connected to 192.168.1.5.
220 (vsFTPd 1.2.1)
ユーザ名を入力
User (192.168.1.5:(none)): linux
331 Please specify the password.
パスワードを入力
Password:
230 Login successful.
転送モードをバイナリモードにする
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.
サーバの秘密鍵を削除
ftp> delete /home/linux/.ssh/id_rsa
250 Delete operation successful. ← 削除が成功した
FTP接続を終了
ftp> bye
221 Goodbye.
C:\>
ローカルの確認
C:\>dir
ドライブ C のボリューム ラベルがありません。
ボリューム シリアル番号は 649A-F32D です
C:\ のディレクトリ
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 ← コピーされている
2004/09/22 10:02 <DIR> Program Files
2004/09/06 11:58 <DIR> WINDOWS
3 個のファイル 951 バイト
3 個のディレクトリ 5,651,943,424 バイトの空き領域
DOSを終了
C:\>exit
|
FTPサーバの終了 # /etc/rc.d/init.d/vsftpd stop vsftpd を停止中: [ OK ] |
FTPサーバのアンインストール # yum -y remove vsftpd Gathering header information file(s) from server(s) Server: Fedora Core 2 - i386 - Base Server: Fedora Legacy utilities for Fedora Core 2 Server: Fedora Core 2 - i386 - Released Updates Finding updated packages Downloading needed headers Resolving dependencies Dependencies resolved I will do the following: [erase: vsftpd 1.2.1-5.i386] Downloading Packages Running test transaction: Test transaction complete, Success! Erasing: vsftpd 1/1 Erased: vsftpd 1.2.1-5.i386 Transaction(s) Complete 備考)アンインストールしなくてもサービスを止めるだけでも構わない。 FTPサービスの自動起動停止 # chkconfig vsftpd off FTPサービスの自動起動確認 # chkconfig --list vsftpd vsftpd 0:オフ 1:オフ 2:オフ 3:オフ 4:オフ 5:オフ 6:オフ 全てのランレベルがオフになっているので、自動起動される事はない。 |