How to setup SFTP server on a GL.iNet router

greenant

Novice Member
I'm trying to set up a SFTP server on a cheap little N300 Mini Wireless Router (GL.iNet GL-MT300N-V2 "Mango"). It runs OpenWRT.

Has anyone got anywhere with installing SFTP on an OpenWRT device? The aim is to serve some videos over the internet via the attached USB drive. Possibly culminating in using it with something like Kodi when away from home.

The Web interface on the router allows me to install "openssh-sftp-server" but I'd want some level of user control. I'm assuming this is more for full root admin of the router. I'd also want flexibility of being able to serve a couple of videos concurrently. So for now I'm passing on this option.

The Web interface also allows me to install "vsftpd" (or "vsftpd-tls"). This is more promising and is supposed to be a robust lightweight general FTP server. But after googling how to set it up for SFTP it was clear as mud. It seems this is more for FTPS security, which is a different protocol and not what I want.

After poking around on OpenWRT's website it mentions in a general article that "vsftpd" vs "ProFTPd" are good options for an FTP server. So I turned my attention to ProFTPd. While this FTP server is supposed to be more bloated, the instructions for setting up SFTP seemed vastly more clear. A case of enabling mod_sftp by uncommenting a line in one of its config files.

BUT... I can't see how to install ProFTPd. The Web interface for the router doesn't list it as an option. SSH-ing into the router and using "opkg install proftpd" didn't find it either. Neither did "opkg update", "opkg list proftpd", "opkg info proftpd" etc.

Looking at the /etc/opkg/distfeeds.conf file it only lists URLs for the manufacturers (GL.iNet) own server. So I wondered if they just forgot to carry over some of the packages from OpenWRT. In theory, if I had a URL to OpenWRT server I could pop it in the "/etc/opkg/customfeeds.conf" file and then try the "opkg install proftpd" command again. And given OpenWRT did recommend ProFTPd I would expect the package to be available there!

BUT... OpenWRT's website does not list the proftpd package on their search page. And downloading their CSV file which lists every available package for OpenWRT drew a blank too. It shows aforementioned vsftpd in both searches, but no sign of ProFTPd.

Am I missing something obvious here? Any insight welcome. I'm a noob with OpenWRT.

Thanks, Ant
 

brunation

Well-known Member
Not an openwrt user so cannot help with the install.

Possibly culminating in using it with something like Kodi when away from home.

NFS over SSH - securely mount your remote NAS drives from far away ......

The Web interface on the router allows me to install "openssh-sftp-server" but I'd want some level of user control. I'm assuming this is more for full root admin of the router. I'd also want flexibility of being able to serve a couple of videos concurrently. So for now I'm passing on this option.

I'd install openssh-sftp-server and get that working first.

IIRC:

You don't want root access via ssh.
You don't want passwords.
You want an account you can ssh into and the switch to root if you need to.
If you have said account then sftp [email protected] will get you into the home directory.
Just make sure its secure.
 

greenant

Novice Member
Thanks for the reply.

I avoided openssh-sftp-server so far because I'm aware ProFTPd doesn't make use of it for SFTP and I didn't want to complicate things further by introducing potential conflicts. Their mod_sftp addon is self contained.

As far as vsftpd goes, I read that it can make use of openssh-sftp-server, but they suggested a two step solution of logging into SSH first and then using vsftpd from there. I can see how that would work, because vsftpd wouldn't even need to know about SSH, but it's a lousy solution, would be cumbersome to get working with various software UIs, and doesn't even jail the users to specified folders, regardless of vsftpd security. Haven't been impressed by vsftpd at all.

The router manufacturer got back to me to confirm ProFTPd is not in OpenWRT.

So after all that... it does seem I'm back to openssh-sftp-server. It won't be as simple or elegant as a self contained ftp server but after reading an article it does look like it's possible to do what I want with it (constrain users to folders etc). It just takes more fiddling around. Oh well.
 

The latest video from AVForums

AVForums Movies Podcast: Streaming Theatrical Releases And The Future Of Cinema
Subscribe to our YouTube channel
Support AVForums with Patreon

Top Bottom