Created
March 28, 2014 05:39
-
-
Save satomixx/9826079 to your computer and use it in GitHub Desktop.
さくらVPSでFTPを使える様にした ref: http://qiita.com/tsumekoara/items/11382273624621f3caee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ yum install vsftpd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//vsftpdを 起動 | |
$ sudo /etc/rc.d/init.d/vsftpd start | |
//自動起動を有効化 | |
$ sudo chkconfig vsftpd on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo /etc/rc.d/init.d/iptables restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ lsmod | |
--- | |
// ここにモジュールがあればOK | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 設定ファイルのバックアップを取ります。 | |
$ cd | |
$ mkdir origin | |
$ sudo cp /etc/vsftpd/vsftpd.conf origin | |
// 設定ファイルの編集。 | |
$ sudo vim /etc/vsftpd/vsftpd.conf | |
---- | |
#アスキーモードを有効にする | |
ascii_upload_enable=YES | |
ascii_download_enable=YES | |
# TCP/IP でのフィルタリングを無効にする (iptables で一応OK) | |
tcp_wrappers=NO | |
# 日本時間を使用 | |
use_localtime=YES | |
# anonymous を無効にする | |
anonymous_enable=NO | |
# /var/log/vsftpd.log にログを記入 | |
xferlog_std_format=NO | |
# ログを有効にする | |
dual_log_enable=YES | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# useradd hoge | |
# passwd hoge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo vim /etc/vsftpd/vsftpd.conf | |
--- | |
# /etc/vsftpd/user_list に記述されたユーザーを拒否する | |
userlist_deny=NO | |
# 全てのローカルユーザーにchrootを有効にする。 | |
chroot_local_user=YES | |
chroot_list_enable=NO | |
# vsftpdのルートディレクトリを /home/hoge/public_html に設定 | |
local_root=/home/hoge/public_html | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo vim /etc/vsftpd/user_list | |
--- | |
# vsftpd userlist | |
# If userlist_deny=NO, only allow users in this file | |
# If userlist_deny=YES (default), never allow users in this file, and | |
# do not even prompt for a password. | |
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers | |
# for users that are denied. | |
hoge | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo vim /etc/sysconfig/iptables | |
--- | |
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT (追記) | |
--- | |
$ sudo /etc/rc.d/init.d/iptables restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo iptables -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT | |
$ sudo /etc/rc.d/init.d/iptables save |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vsftpd の設定を反映 | |
$ sudo /etc/rc.d/init.d/vsftpd restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo vim /etc/sysconfig/iptables-config | |
--- | |
# 以下を追記 | |
IPTABLES_MODULES="ip_conntrack_ftp ip_nat_ftp" | |
--- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment