Input command
- Df-h
Copy Code
View your own partition path, I used an idle laptop hard drive to USB, plug into mini, there are four zones
For convenience, I chose to install FTP on the first partition/extdisks/sda1/
To create an FTP installation directory, enter:
- Mkdir-m 0777-p/extdisks/sda1/ftp
Copy Code
(Troublesome children's shoes can be made by way of WINSCP tools)
then back up . /etc/opkg.conf, enter:
- Cp/etc/opkg.conf/etc/opkg.conf-backup
Copy Code
Edit/etc/opkg.conf, enter:
- Vi/etc/opkg.conf
Copy Code
Click I edit, delete the contents of the content, and then paste the following content,The x in the path please change to your own FTP directory file name:
Src/gz Barrier_breaker_base Http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/base
Src/gz Barrier_breaker_luci Http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/luci
Src/gz barrier_breaker_packages Http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/packages
Src/gz barrier_breaker_routing http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/routing
Src/gz Barrier_breaker_telephony Http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/telephony
Src/gz barrier_breaker_management http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/management
Src/gz barrier_breaker_oldpackages Http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/oldpackages
Dest root/extdisks/sda1/x
Dest Ram/tmp
Lists_dir ext/extdisks/sda1/x/opkg-lists
Option overlay_root/extdisks/sda1/x
Dest usb/extdisks/sda1/x
Save Click the ESC key, then click: Key (shift+;), then enter WQ carriage return.
Verify success, enter:
- OPKG Update
Copy Code
The success results will show the following:
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/base/Packages.gz.
Updated List of available packages in/extdisks/sda1/x/opkg-lists/barrier_breaker_base.
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/luci/Packages.gz.
Updated List of available packages In/extdisks/sda1/x/opkg-lists/barrier_breaker_luci.
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/packages/Packages.gz.
Updated List of available packages in/extdisks/sda1/x/opkg-lists/barrier_breaker_packages.
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/routing/Packages.gz.
Updated List of available packages in/extdisks/sda1/x/opkg-lists/barrier_breaker_routing.
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/telephony/Packages.gz.
Updated List of available packages in/extdisks/sda1/x/opkg-lists/barrier_breaker_telephony.
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/management/Packages.gz.
Updated List of available packages in/extdisks/sda1/x/opkg-lists/barrier_breaker_management.
Downloading http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/oldpackages/Packages.gz.
Updated List of available packages in/extdisks/sda1/x/opkg-lists/barrier_breaker_oldpackages.
Start installing FTP and enter the following commands in order:
- cd/extdisks/sda1/x/
Copy Code
- wget HTTP://DOWNLOADS.OPENWRT.ORG/BARRIER_BREAKER/14.07/RAMIPS/MT7620A/PACKAGES/BASE/LIBC_0.9.33.2-1_RAMIPS_24KEC.IPK
Copy Code
- opkg-d USB Install LIBC_0.9.33.2-1_RAMIPS_24KEC.IPK
Copy Code
- opkg-d USB Install VSFTPD
Copy Code
Here the FTP basic installation is complete, but also need to set up a bit
Input: VI/EXTDISKS/SDA1/X/ETC/INIT.D/VSFTPD
Delete the old content, add the following content
- #!/bin/sh/etc/rc.common
- # Copyright (C) 2006-2011 openwrt.org
- Start=50
- Start () {
- Mkdir-m 0755-p/var/run/vsftpd
- Service_start/extdisks/sda1/x/usr/sbin/vsftpd
- }
- Stop () {
- Service_stop/extdisks/sda1/x/usr/sbin/vsftpd
- }
Copy Code
Save exit
Then enter:
- Vi/etc/vsftpd.conf
Copy Code
Copy the following to the inside, provide two versions for everyone to choose one, simple version and strict version .
simple version, easy-to-use, is ready, but less secure.
Background=yes
Listen=yes
Listen_port=21
Anonymous_enable=yes
Anon_upload_enable=yes
Anon_mkdir_write_enable=yes
idle_session_timeout=300
Max_clients=5
Max_per_ip=5
Local_enable=yes
Write_enable=yes
local_umask=022
Check_shell=no
anon_root=/extdisks/sda1/
local_root=/extdisks/sda1/
Ftp_username=nobody
#dirmessage_enable =yes
#ftpd_banner =welcome to blah FTP service.
Session_support=no
#syslog_enable =yes
#userlist_enable =yes
#userlist_deny =no
#userlist_file =/extdisks/sda1/x/etc/vsftpd.users
#xferlog_enable =yes
#xferlog_file =/var/log/vsftpd.log
#xferlog_std_format =yes
Chown_uploads=yes
Chown_username=root
Security Strict version, do not understand please Baidu the following parameters, with/etc/passwd set user rights, increased safety factor.
Background=yes
Listen_port=21
Anonymous_enable=no #匿名用户登录, does not open by default
Anon_upload_enable=yes
Anon_mkdir_write_enable=yes
idle_session_timeout=300
Max_clients=5
Max_per_ip=5
Local_enable=yes #本地用户登录开启, you can log in with users such as root
Write_enable=yes
file_open_mode=0777
local_umask=022
Check_shell=no
anon_root=/extdisks/sdax/x/#匿名用户访问的目录
local_root=/extdisks/sdax/x/#本地用户访问的目录
Chown_uploads=yes
Chown_username=ftp
Ftp_username=ftp
#dirmessage_enable =yes
#ftpd_banner =welcome to blah FTP service.
Session_support=no
#syslog_enable =yes
Userlist_enable=yes
Userlist_deny=no
Userlist_file=/etc/vsftpd/user_list1 #自己按需要创建文件, join user root so that root can log in, one user at a line
Chroot_list_enable=yes
Chroot_list_file=/etc/vsftpd/user_list2 #自己按需要创建文件, join user root so that root can log in, one user at a line
#xferlog_enable =yes
#xferlog_file =/var/log/vsftpd.log
#xferlog_std_format =yes
Allow_writeable_chroot=yes
Save Press ESC, and then press: once, enter Wq to save.
to open FTP, enter:
- /EXTDISKS/SDA1/X/ETC/INIT.D/VSFTPD start
Copy Code
If not shown, it is generally successful.
To verify that the FTP was successful, enter it in the resource manager:
ftp://Router IP
Because of the security policy of the relationship, will pop up you do not have permission to the window, do not worry, in the screen right-click Login, log in with Root.
==============================================================
The following are self-booting, and open the external FTP port
==============================================================
The self-starting method is actually very simple, edit usb_deploy_init_script.sh
The command is as follows:
- vi/etc/init.d/usb_deploy_init_script.sh
Copy Code
find the following two lines
Rm-rf/tmp/xiaomi_router
Mkdir-p/tmp/xiaomi_router
Add a line below the command
- /EXTDISKS/SDA1/X/ETC/INIT.D/VSFTPD start
Copy CodeOpen the extranet port and modify the firewall
- Vi/etc/config/firewall
Copy CodeAdd the following code to the last blank lineConfig ruleoption name ' FTP 'option src ' wan 'option prot ' TCP 'option Dest_port ' + 'option target ' ACCEPT 'option Family ' IPv4 '
Save exit.
Restart the firewall to take effect, enter:
- /etc/init.d/firewall restart
Copy Code=================================================================
=================================================================
Security settings (a friend who needs to set security permissions can see)
Aside : FTP can cooperate with DDNS, this is absolutely no problem, if you have your own independent domain name, you can also cname bind peanut shell domain name, it is equivalent to bind their own personal domain name.
Security Setting Method:/etc/passwd This is to set the user name, edit it with WINSCP, for example, to increase the FTP user, the default already has an FTP record
The default format is Ftp:*:55:55:ftp:/home/ftp:/bin/falsethe previous FTP is the FTP user name, also represents the FTP login name, the following FTP name does not need to reason. The preceding 55 and 55 are the default, which represents the priority permission, which can be ignored. * No need to talk. /home/ftp is the directory that is visible after the FTP default login, it is best to modify it to match the ftp login path. The/bin/false representative does not allow this FTP user to log in using SSH, by default. For example, the format I use myself is:Ftp:*:55:55:ftp:/extdisks/sda1/ftp:/bin/false
usually after modifying this one, the user group/etc/group has a ftp:x:55: User group record by default, so you can skip to the next step.
then in the command line mode to modify the password of the FTP user (recommended to use Putty English version of the change, do not use WINSCP,WINSCP will be lost password)Putty Login Root, enter:passwd FTPYou can enter the same password two times.
Xiaomi Router Mini built FTP