1.3 KiB
Enable FTP Server with /
as FTP Root
Disclaimer: - This is Only for educational purposes, No one is responsible for any type of damage. Any wrong step might brick your router. So be aware.
-
First of all, follow this guide to enable root access to your router.
-
Use command
pkill vsftpd
to kill any already running FTP server on your router. -
Using
vi
, create/flash/vsftpd.conf
and add these lines:anonymous_enable=NO local_enable=YES write_enable=YES dirmessage_enable=YES xferlog_enable=YES connect_from_port_20=YES listen_port=21 idle_session_timeout=300 max_clients=200 max_per_ip=200 chroot_local_user=YES ftp_username=root secure_chroot_dir=/ local_root=/ listen_ipv6=YES userlist_enable=no userlist_deny=NO
-
Save the file.
-
Use command
vsftpd /flash/vsftpd.conf &
to start the FTP server. -
Use command
iptables -I fwInBypass -p tcp --dport 21 -m ifgroup --ifgroup-in 0x1/0x1 -j ACCEPT
to enable listening to port 21. -
Connect your router using FTP client like FileZilla using
root
as username and your root password as the password.
P.S. : You can also make a .sh
script in /flash/
or /flash2/
to automate this process.