FTPの起動
FTPの起動
SSHの秘密鍵をWindowsに持ってくる手段としてFTPを動かすことにした。
とりあえずファイアウォールはGUIで使うときだけ開けることにする。
まず、FTPのログローテートを設定する。
# su -
パスワード(P):
# mkdir /var/log/proftpd … ログを保存するディレクトリを作成
# vi /etc/logrotate.d/proftpd … ログローテートの設定
# cat /etc/logrotate.d/proftpd
/var/log/xferlog {
missingok
notifempty
postrotate
/usr/bin/kill -HUP `cat /var/run/proftpd.pid 2>/dev/null` 2>/dev/null || true
endscript
}
/var/log/proftpd/*.log {
missingok
notifempty
postrotate
/usr/bin/kill -HUP `cat /var/run/proftpd.pid 2>/dev/null` 2>/dev/null || true
endscript
}
[root]#
proftpdのコンフィグを書き換える。
# vi /etc/proftpd.conf
# cat /etc/proftpd.conf
# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use. It establishes a single server
# and a single anonymous login. It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.
#ServerName "ProFTPD Default Installation"
ServerName "FTP Server"
ServerType standalone
DefaultServer on
# FFFTPで.htaccess等の./等で始まるファイルを表示、削除できるようにする
ListOptions "-a"
# 接続された時に表示されるメッセージを記述
ServerIdent on "FTP OK"
# off にして高速に接続
UseReverseDNS off
IdentLookups off
# グループ"admin"以外は自分のホームディレクトリの/public_htmより上位層には行けないように設定
#DefaultRoot ~/public_html !admin
# Port 21 is the standard FTP port.
Port 21
# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask 022
# Use localtime
TimesGMT FALSE
# To prevent DoS attacks, set the maximum number of child processes
# to 30. If you need to allow more than 30 concurrent connections
# at once, simply increase this value. Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances 30
# パスワードの入力ミスは3回まで
MaxLoginAttempts 3
# Set the user and group under which the server will run.
User nobody
Group nobody
# iconv patch: set local/remote encoding
# http://www.hakusan.tsg.ne.jp/tjkawa/software/misc/proftpd-iconv/index.jsp
CharsetLocal EUC-JP-MS
# CharsetRemote CP932
CharsetRemote EUC-JP-MS
# Normally, we want files to be overwriteable.
AllowOverwrite on
# Anonymousの設定はすべてコメントアウト
# A basic anonymous configuration, no upload directories.
#
#User ftp
#Group ftp
# We want clients to be able to login with "anonymous" as well as "ftp"
#UserAlias anonymous ftp
# Limit the maximum number of anonymous logins
#MaxClients 10
# do not require shells listed in /etc/shells (user ftp do not have
# shell...)
#RequireValidShell no
# We want 'welcome.msg' displayed at login, and '.message' displayed
# in each newly chdired directory.
#DisplayLogin welcome.msg
#DisplayFirstChdir .message
# Limit WRITE everywhere in the anonymous chroot
#
#DenyAll
#
#
# for Log
LogFormat allinfo "%t : %u (%a [%h]) : [%s], %T, %m (%f)"
LogFormat write "%t : %u : %F (%a)"
LogFormat read "%t : %u : %F (%a)"
LogFormat auth "%t : %u (%a [%h])"
ExtendedLog /var/log/proftpd/all.log ALL allinfo
ExtendedLog /var/log/proftpd/write.log WRITE write
ExtendedLog /var/log/proftpd/read.log READ read
ExtendedLog /var/log/proftpd/auth.log AUTH auth
[root]#
FTPデーモンを起動
# /etc/rc.d/init.d/proftpd stop
ProFTPdを停止中: [ OK ]
ProFTPdを起動中: [ OK ]
#
SSHの設定
PuTTYGENで秘密鍵を変換
PuTTYにロードして接続OK
LinuxボックスはCTUに接続しアダプタモードで接続しているIP電話対応ルータに接続している。同じネットワークにあるWindowsパソコンからはSSHで接続できるようになったし、Webminも使えるようになったが、CTUに直接接続しているWindowsパソコンからは接続できない。
このパソコンはWindoows Vistaで、ルーティングテーブルの追加コマンド ROUTE ADD コマンドは一般ユーザでは実行できないので、コマンドプロンプトを右ボタンでクリックし管理者として開いて実行した。
C:\>
C:\>route -p ADD 192.168.xxx.0 MASK 255.255.255.0 192.168.24.xxx METRIC 3
OK!
C:\>
これでプライベートのネットワークからは接続できるようになった。
Webminのインストール
LinuxファイアウォールをGUIで許可




