2014-12-7

1.最小安裝 192.168.0.64
2.安裝perl
yum install perl
3.發現沒有ifconfig
yum install net-tools
4.安裝VMWare-Tools

2014-12-8

安裝 vsftpd

#yum install vsftpd ftp -y
#rpm -qa vsftpd                    //查詢 vsftp 套件版本
  vsftpd-3.0.2-9.el7.x86_64
#rpm -qc vsftpd |grep vsftpd.conf  //查詢 vsftp 設定檔路徑
  /etc/vsftpd/vsftpd.conf

設定 vsftpd

編輯 vsftpd 設定檔 /etc/vsftpd/vsftpd.conf,

vi /etc/vsftpd/vsftpd.conf

Find the following lines and make the changes as shown below:

 [...]
// Disable anonymous login 
anonymous_enable=NO

// 限制使用者只能在自己的家目錄
chroot_local_user=YES
// 啟用例外清單
chroot_list_enable=YES
// 例外清單檔案位置
chroot_list_file=/etc/vsftpd/chroot_list
//此行請自新增加
allow_writeable_chroot=YES

## Uncomment - Enter your Welcome message - This is optional ##
ftpd_banner=Welcome to UNIXMEN FTP service.

## Add at the end of this  file ##
use_localtime=YES

## Set PASV Mode port range ##
pasv_min_port=40000
pasv_max_port=41000


Enable and start the vsftpd service:

systemctl enable vsftpd
systemctl start vsftpd

Firewall And SELinux Configuration

Allow the default ftp port 21 and 40000-41000 via firewall.

firewall-cmd --permanent --add-port=21/tcp
firewall-cmd --permanent --add-port=40000-41000/tcp

Restart firewall:

firewall-cmd --reload

Then, update the SELinux boolean values for FTP service:

getsebool -a | grep ftp
setsebool -P ftp_home_dir on


Enable Passive Mode in FTP on CentOS 7 / RHEL 7 for FileZilla and WinSCP

FileZilla uses passive mode as a default file transfer mode; but the vsftp is configured to use active mode by default.

We have two options,

  1. Configure FileZilla to use active mode.
  2. Configure FTP server in passive mode.

Use any one method.

Configure FileZilla to use active mode:

In this case, you do not require to modify vsftp server. Change FileZilla transfer mode from passive to active.

In Linux Mint, View —> Settings —> FTP, Select Transfer Mode as Active

CentSo 7 - vsftp FileZilla - Active Mode Selection

Configure FTP server in passive mode:

In this case, you do not require to modify FileZilla. Change vsftp transfer mode from active to passive, edit the configuration file of ftp server

# vi /etc/vsftpd/vsftpd.conf

Add the following lines at the end of the file.

pasv_enable=Yes
pasv_max_port=40000
pasv_min_port=40000

Restart the service.

# systemctl restart vsftpde

Allow the port (TCP 40000) in iptables in order to connect ftp server over the network.

# firewall-cmd --permanent --add-port=40000/tcp
# firewall-cmd --reload

Now access ftp using FileZilla, you can see in the message; it is using passive mode for transferring file as the ftp server supports it.

 

 

 

最後修改日期: 2014-12-11

作者

留言

撰寫回覆或留言