Jump to content
SlrG

[DOCKER CONTAINER] glFTPd

75 posts in this topic Last Reply

Recommended Posts

glFTPd

Support the container?

btn_donate_SM.gif

unRAID docker container for glftpd: (http://glftpd.eu/)

 

Important note:


glFTPd is not an easy to use ftp server. I recommend to install my ProFTPd-Plugin instead. It is much more integrated with the unRAID user management system and most of the times easier to use.


 

To install glFTPd use the SlrG Docker Repository: https://github.com/SlrG/docker-templates.

 

/usr/bin/docker run -d –name=“glFTPd” –net=“host” -v “/mnt/cache/your/glftpd/folder”:“/glftpd”:rw slrgde/glftpd

 

The path needs to be on a cache only share and must be given as /mnt/cache/...!

 

 

When using glFTPd for the first time, make sure to connect via ftp from localhost. The default user and password is glftpd. Create a new site op user and delete the glftpd one. Otherwise you'll not be able to access glFTPd from remote hosts.

 

To login you can use the ftp client inside the running docker container or install an ftp client package on your unRAID and use that to connect to glFTPd without entering the container.

 

docker exec -ti glFTPd /bin/bash
ftp localhost 1337

 

When logged in:

site adduser username password
site addip username *@*
site change username flags +147ABCDEFGHI
site deluser glftpd

 

After reconnecting as username:

site purge *

 

The mounting seems to have stopped working!

The ftp data must be added to the "site" dir in the glftpd folder. If you don't want to copy data to that dir, that you already have on your array, you will need the powerdown plugin and utilize its S(tart) and K(ill) scripts to execute mount and umount commands. Make sure the commands are executed before the docker starts and after it stops:

 

mkdir /mnt/cache/glftpd/site/movies;mount --bind /mnt/user0/movies/ /mnt/cache/glftpd/site/movies/

 

umount /mnt/cache/glftpd/site/movies;rmdir /mnt/cache/glftpd/site/movies

 

 

Initial glFTPd Setup:

root@lafiel:/# docker exec -ti glFTPd /bin/bash

root@lafiel:/# ftp localhost 1337

Connected to lafiel.

220 MY SITE NAME (glFTPd 2.05.2 (Mar 21 2015) 64BiT Linux+TLS(OpenSSL 1.0.1e 11 Feb 2013 - built on: Tue Mar 17 21:27:52 UTC 2015)+SSP) ready.

Name (localhost:root): glftpd

331 Password required for glftpd.

Password: glftpd

230-                                _____

230- ______________________________|__  |____ ________________________________

230- \    _      /  _    /  _    /  |    |    _    /  _    /    _      /

230-  \    \    /    /    /  /____/.  |    |    /    /  /____/.    /_____/

230-  \________/____/    /______    |___|____|___/    /______    |____|

230- .-=----------- /____/ ---- |____| --------- /____/ ---- |____| -------=-.

230- `-=-------------------------------------------------------------------=-'

230-      `-----( Type 'site onel MESSAGE' to enter your message )-----'

230 User glftpd logged in.

Remote system type is UNIX.

Using binary mode to transfer files.

ftp> site adduser michael password

200 User (michael) successfully added.

ftp> site addip michael *@*

200- IP '*@*' successfully added to michael.

200 Command Successful.

ftp> site change michael flags +147ABCDEFGHI

200 Command Successful.

ftp> site deluser glftpd

200 Thank you for deleting yourself.

ftp> quit

root@lafiel:/# ftp localhost 1337

Connected to lafiel.

220 MY SITE NAME (glFTPd 2.05.2 (Mar 21 2015) 64BiT Linux+TLS(OpenSSL 1.0.1e 11 Feb 2013 - built on: Tue Mar 17 21:27:52 UTC 2015)+SSP) ready.

Name (localhost:root): michael

331 Password required for michael.

Password: password

230-                                _____

230- ______________________________|__  |____ ________________________________

230- \    _      /  _    /  _    /  |    |    _    /  _    /    _      /

230-  \    \    /    /    /  /____/.  |    |    /    /  /____/.    /_____/

230-  \________/____/    /______    |___|____|___/    /______    |____|

230- .-=----------- /____/ ---- |____| --------- /____/ ---- |____| -------=-.

230- `-=-------------------------------------------------------------------=-'

230-      `-----( Type 'site onel MESSAGE' to enter your message )-----'

230 User michael logged in.

Remote system type is UNIX.

Using binary mode to transfer files.

ftp> site purge *

200- User (glftpd) purged.

200-

200 Command successful.  (1 Users Purged)

ftp>

Share this post


Link to post

Thanks for this,

 

I've successfully added the docker and followed your instructions (I think!)

 

I've got to the point that if I run

 

docker exec -ti glFTPd /bin/bash
ftp localhost 1337

 

Then I can successfully log in with my new username and password, I have also run

 

site purge *

 

However if I try to connect to the FTP server (My Unraid IP is 192.168.1.1) with Filezilla I cannot.

 

I get the error

 

Status:	Connecting to 192.168.1.1:21...
Status:	Connection established, waiting for welcome message...
Status:	Insecure server, it does not support FTP over TLS.
Command:	USER username
Response:	530 Permission denied.
Error:	Could not connect to server

 

I'm unsure where to go from here, I was wondering if what I'm actually trying to do is fundamentally wrong. 

 

One thing I have noticed is that in my Unraid settings - FTP Server is that it is running and I have a sneaky, although maybe incorrect, suspicion that may be the root of the problem, however I can't find any way to stop the native Unraid FTP Server, according to the wiki if there are no users added then it shouldn't run, but it appears this isn't the case. I did admittedly add a username here sometime ago in an effort to get FTP working on my Unraid box but to no avail and I have since deleted this user and restarted my Unraid box several times.

 

Any thoughts or pointers would be most welcome.

Share this post


Link to post

Hmm... Going by that error message I would say you try to connect with TLS from FileZilla to the server. That does not work if you have not configured the server to use TLS, too. So either disable TLS in FileZilla or configure glFTPd to use TLS.

 

When I tried TLS, I had to create a new rsa key on the server. FileZilla was not able to connect using the default key created by glFTPd on installation.

Share this post


Link to post

Also sorry for the late reply. It seems I forgot to enable the notifications for this thread. So I was not informed of your post. This is fixed now, so new replies should be quicker.

Share this post


Link to post

Also sorry for the late reply. It seems I forgot to enable the notifications for this thread. So I was not informed of your post. This is fixed now, so new replies should be quicker.

 

No worries, just figured you were busy!

 

Got connected, I was connecting to the wrong port - 21 instead of 1337, using TLS (although I had tried all the protocols at various stages)

 

I'll have a bit more of a play around and post back with any more daft questions!  ;D

 

Thanks for the docker and the help mate.

Share this post


Link to post

 

The ftp data must be added to the "site" dir in the glftpd folder. If you don't want to copy data to that dir, that you already have on your array, you will need the powerdown plugin and utilize its S(tart) and K(ill) scripts to execute mount and umount commands:

 

mkdir /mnt/cache/glftpd/site/movies;mount --bind /mnt/user0/movies /mnt/cache/glftpd/site/movies

 

umount /mnt/cache/glftpd/site/movies;rmdir /mnt/cache/glftpd/site/movies

 

So I'm trying to use this to enable FTP in wordpress to update plugins and such like.

 

I've ran this command

 

mkdir /mnt/cache/appdata/glftpd/site/wordpress;mount --bind /mnt/cache/appdata/apache/web/wordpress /mnt/cache/appdata/glftpd/site/wordpress

 

And from windows explorer everything works as expected and I can see all the files in glftpd/site/wordpress that are actually in /apache/web/wordpress

 

However when I use Filezilla the directory is showing as empty and using Wordpress' FTP function it tells me that the subfolder wp-content cannot be found.

 

Is this some sort of permissions error?  Any ideas?

Share this post


Link to post

Tried to get this to work on my system too and you are right. It fails. As to why it does, I have no clue yet. At the moment I think it would be easier to switch to my ProFTPd plugin for unRAID v6. That should give you what you want more easily than glFTPd.

Share this post


Link to post

Tried to get this to work on my system too and you are right. It fails. As to why it does, I have no clue yet. At the moment I think it would be easier to switch to my ProFTPd plugin for unRAID v6. That should give you what you want more easily than glFTPd.

 

Cool, still a great docker, hopefully a solution is out there, I'd love to help but it's way outside of my knowledge.  But if you need any help checking stuff out then send me a PM and tell me what you want me to do.

Share this post


Link to post

Tried to get this to work on my system too and you are right. It fails. As to why it does, I have no clue yet. At the moment I think it would be easier to switch to my ProFTPd plugin for unRAID v6. That should give you what you want more easily than glFTPd.

 

Plugin works great, I'm very biased towards dockers nowadays but that is one sweet plugin design, I love the user management, very easy once I got my head around it.

Share this post


Link to post

As I really like and prefer the docker route too, I first tried to create a docker for ProFTPd before creating the new v6 plugin. While this is possible, I was not able to tie it to the unRAID user management in the same way the old v5 plugin did.  And this was something I didn't want to loose, so in the end I decided to go the plugin route once again for ProFTPd.

 

As glFTPd uses its own user management, a docker was the better choice. I don't like, that I have to use host networking for that one, but with future docker versions that should be fixable, once they support exposing port ranges.

 

Also its a mayor drawback, that mounting doesn't work anymore. With the old v5 glftpd plugin it did. I'll try to look deeper into the problem. Sadly glFTPd is not as widespread as other ftp servers and thus its hard to find solutions online.

Share this post


Link to post

As FTP access is built into Unraid, and the plugin is working so well that is probably a better solution than a docker that is less user friendly.

 

And the plugin is awesome, got it up and running within five minutes and it is very intuitive, the approach to user management is awesome and incredibly innovative.

Share this post


Link to post

Thank you very much. :) I'm glad you like the plugin. With a lot of testing I found a new approach to mount things into the glftpd site dir, that works. Its a bit more complicated. The mkdir command part stays the same. The mount must use a user share available on your server and looks like this:

 

mount -t cifs -o user=guest,uid=nobody,gid=users,dir_mode=0777,file_mode=0666,auto,rw //SERVER_IP/movies/ /mnt/cache/glftpd/site/movies/

 

You have to restart the docker after creating the mount.

 

It would be cool if dockers could run such mount and unmount or other bash commands before starting and stopping a container.

 

edit: It seems the old command also works after restarting the container. Maybe glftpd scans the subfolders of "site" on start and blocks access to folders added later on. 

Share this post


Link to post

It seems the old command also works after restarting the container. Maybe glftpd scans the subfolders of "site" on start and blocks access to folders added later on.

 

Yep, so it does.

 

So, my problem was I didn't turn it on and off again - oh the shame!!  :-[

PEBKAC!

 

Haven't tried the new method as the old seems to be working!

Share this post


Link to post

Yes. :) I'll add it. Thanks for pointing me to the thread.

Share this post


Link to post

im going to ask the stupid question

 

can this container go out and connect to a seedbox and pull files?

Share this post


Link to post

This is a server no client. So you can't login to it and let it pull files from some other location.

 

What you can do, is connecting to this docker with a client FTP program and upload/download files from it. That is its intended use case.

 

You further options differ, depending on if your seedbox is the same unRAID you have the docker installed.

 

Same box:

If you want to provide access to files of your seedbox with FTP, you need to mount the directories containing those files into the glftpd site dir. Those mounts will have to be renewed on every boot and removed before shutting down or your array will hang. Either use the powerdown plugins scripts to do so or have a look at the ProFTPd plugin, which has its own mount and unmount scripts, that will be run on start and stop of the array.

 

Different box:

If you are on your seedbox and use a FTP client from there to connect to this docker, you will be able to upload files. This will duplicate the files however. But you will be able to download them from the docker FTP afterwards.

 

If you just want to download files from someone elses seedbox to store and use them on your unRAID system, use a ftp client to connect to the seedbox and let it download to a share of your unRAID system.

Share this post


Link to post

This is a server no client. So you can't login to it and let it pull files from some other location.

 

What you can do, is connecting to this docker with a client FTP program and upload/download files from it. That is its intended use case.

 

You further options differ, depending on if your seedbox is the same unRAID you have the docker installed.

 

Same box:

If you want to provide access to files of your seedbox with FTP, you need to mount the directories containing those files into the glftpd site dir. Those mounts will have to be renewed on every boot and removed before shutting down or your array will hang. Either use the powerdown plugins scripts to do so or have a look at the ProFTPd plugin, which has its own mount and unmount scripts, that will be run on start and stop of the array.

 

Different box:

If you are on your seedbox and use a FTP client from there to connect to this docker, you will be able to upload files. This will duplicate the files however. But you will be able to download them from the docker FTP afterwards.

 

If you just want to download files from someone elses seedbox to store and use them on your unRAID system, use a ftp client to connect to the seedbox and let it download to a share of your unRAID system.

 

Yes the third option, what im having to do is use a pc to connect to the seedbox and pull the files and put them into my unraid box.

I just a plugin and docker for apache web server that I can use to spin up a virtual machine.

i'll go that route, thanks for the help. I might still use this for uploading other files non seed box.

Share this post


Link to post

This is a server no client. So you can't login to it and let it pull files from some other location.

 

What you can do, is connecting to this docker with a client FTP program and upload/download files from it. That is its intended use case.

 

there are a couple of ftp clients that are browser based that would be ideal to put in this container to provide a frontend and backend all in one container.

 

http://freedif.org/monsta-web-ftp-file-manager-in-php-ajax/

 

or

 

http://freedif.org/net2ftp-web-based-ftp-client/

Share this post


Link to post

glFTPd is a rather old school like server. To configure it, ftp site commands can be used. None of the web based solutions and many graphical clients don't support that. While they can be used to upload/download things, they can't be used to do the administration things.

 

Also IMHO it doesn't make sense to use ftp client software within the local network, where you can access your shares easily via samba, nfs or whatever. The reason (IMHO) to provide a ftp-server is mostly to allow downloading/uploading from outside your home network. And then visitors (relatives, friends) most often want to browse the ftp site and download single files only. For these tasks you need no additional software but can use your browser to do it easily.

 

Secondly the docker approach is to keep things simple. It would be better to provide those frontends in a seperate docker each. So at the moment I don't think I want to include one of those.

 

Thank you very much for pointing them out however. :)

Share this post


Link to post

This is a server no client. So you can't login to it and let it pull files from some other location.

 

What you can do, is connecting to this docker with a client FTP program and upload/download files from it. That is its intended use case.

 

there are a couple of ftp clients that are browser based that would be ideal to put in this container to provide a frontend and backend all in one container.

 

http://freedif.org/monsta-web-ftp-file-manager-in-php-ajax/

 

or

 

http://freedif.org/net2ftp-web-based-ftp-client/

 

I would be interested in this, like i said i just need something like a vm. that can connect to the seedbox and pull the file and put it in a folder where unraid will process it. Since i don't have any vm on unraid I'm having to use a secondary pc to do this. just seems silly.

No one has access to my box from the outside.

Share this post


Link to post

@ijuarez: I still think we will need a more in depth explanation what you want to do. If you have your seedbox (what is that? - a transmission or other bittorrent client docker? A vm?) running on your unraid machine, I don't understand why you would need a ftp server to connect to it. Why not let it save it's downloaded files to a share or directory on your unraid server? And like I already explained a ftp server like glftpd serves files. It does not download them.

 

You would need a ftp client to connect and download. That could be done by installing such a ftp frontend. But that is no reason to put it within the glftpd docker. And it would require you to manually initiate the file transfer, which makes no sense, when all you need to do is access the share/directory your seedbox downloads into to get full access to those files. What is my mistake in understanding what you want to do?

Share this post


Link to post

@ijuarez: I still think we will need a more in depth explanation what you want to do. If you have your seedbox (what is that? - a transmission or other bittorrent client docker? A vm?) running on your unraid machine, I don't understand why you would need a ftp server to connect to it. Why not let it save it's downloaded files to a share or directory on your unraid server? And like I already explained a ftp server like glftpd serves files. It does not download them.

 

You would need a ftp client to connect and download. That could be done by installing such a ftp frontend. But that is no reason to put it within the glftpd docker. And it would require you to manually initiate the file transfer, which makes no sense, when all you need to do is access the share/directory your seedbox downloads into to get full access to those files. What is my mistake in understanding what you want to do?

 

Yes what i need is an ftp client

people on here use deluge or trasmission to share ubuntu distos torrents etc etc.

seedbox- is a server farm somewhere  that downloads those ubuntu torrents superfast (1 Gbit) seedbox keeps seeding torrents, i get file and get my linux mint rolling.  ;)

Share this post


Link to post

Okay. What I still don't understand, why do you need this client on your unRAID system? If you are on your home network, you will need another pc to initiate the download anyway, won't you? Even those web ftp solutions above will need a browser running on a pc/tablet/whatever and will abort a download if the browser is closed or the connection lost in some way. Also the data flow will always be from the seedbox to your pc or mobile device and only then to the folder you want to save to. Especially if you connect externally to your nework with a mobile device, that won't really make sense IMHO.

 

What you do want to do is propably initiate the ftp download from the seedbox to your unRAID with some browser gui and then leave your unraid server to do the work. Am I right? Maybe you can check out the pyload docker? I think this supports downloading ftp files, too. The only problem is, you'll have no gui to select the file for download, but will need to add a link to the file you want to download into pyload.

 

Another alternative could be to use a combination of screen and a commandline ftp client on your unRAID system.

Share this post


Link to post

I tried to use the unraid built in ftp, but its just a server does not make call out.

 

Yes , i understand about the pc, needing one. Prior to beta 6 in stable 5 i had virtualbox running and had a win 7 vm that did this for me.

It was a schedule task to run filezilla to connect to the seed box look anything new and ftp it to a mapped drive on the vm that corresponded with a share on the unraid box.

 

with the advantage of dockers i was hoping to make this happen. I will look into those options and see if something can be done, otherwise i will just spin up the apache docker so my phpvirtualbox can be served.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.