Firmware: A-410 [01 Apr. 2014] | A-400 [12 Mar. 2014] | C-300 [13 Feb. 2014] | A-300 [24 Feb. 2014] | C-200 [11 July 2013] | A-200/A-210 [11 July 2013] | Popbox V8 [3 Dec 2013]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Post Reply 
[200] lundftpd installation, configuration and setup package
12-15-2010, 10:11 PM (This post was last modified: 12-19-2010 03:04 PM by dc11ab.)
Post: #1
lundftpd installation, configuration and setup package
LundFTPD is a small, yet feature rich FTP server made by lundman, author of llink and other NMT utilities and hacks.

Detailed information: http://www.lundman.net/wiki/index.php/LundFTPD

DOWNLOAD
CSI package available: http://www.lundman.net/wiki/images/7/7e/...3.17.1.zip
Go to CSI menu and "Install from file..."
CSI: http://www.nmtinstaller.com

USAGE
Connect with FTP client:
User: nmt
Password 1234
Port 2223

* You may want to change the password as the nmt user has full admin privileges.
* Connection over SSL is enabled/available.
* Default FTP-root is /opt/sybhttpd/localhost.drives/

If you want to change the configuration, open the file "lundftpd.conf" (typically in the install directory /share/Apps/lundftpd/) with your text editor. One easy way to do this is to connect to the NMT with SMB or NFS, browse to the lundftpd.conf file and open it with Notepad, vi, Textedit or your favorite text editor of choice.

To add more users, connect to LundFTPD via FTP client and send FTP RAW commands:
site ADDUSER <username> <password> <IP's>
where IP's is * (a single asterisk/star) if you want the user to be able to connect from anywhere.
site SETRATIO <username> <ratio>
This sets the user's ul/dl ratio. Set to -1 for free/no ratio.
site SETFLAGS <username> <user flag> -
Set user's userflag level. UF_NONE is already set as default when a user is created above, UF_ALL means full admin rights.

For more information, issue the FTP command site help

CHANGELOG
3.17.1 - Minor package update:
* FTP root changed from /share/ to /opt/sybhttpd/localhost.drives/
* All internal file checking enabled
* groups_default disabled
3.17.0 - First CSI package release



Original post below.
I successfully compiled LundFTPD 3.17 for my C200. While that in itself is a triumphant success for someone like me (yay!), I still need some help to figure out how to implement and install it properly, and perhaps make a CSI package out of it.

- How can I maintain the start_app.sh community script, yet "swap" the FTP server?
There is "/nmt/apps/etc/ftpserver.sh stop", but I'm not sure it's reliable enough to put in a daemon startup scrip for lundftpd.

- Do I need to add a script that, upon a first time install -for instance via CSI - adds a user nmt password 1234 account, or can I simply tar/zip/CSI-package the existing installation I have?

- Are there any recommended settings in the conf file to think about, having in mind a general and similar setup to the existing FTP service from the NMT Apps?
I'm thinking some people have USB disks instead of SATA_DISK, for instance.

- I did compile with openssl included, but I have not made any keys etc. How should this be handled? (I personally have no need of a secure connection as I only transfer on my LAN, but I guess others could be interested).

Any other comment or pointer would be most welcome, thank you!

Audio, video, disco - I hear, I see, I learn.
Wiki. Wiki? Wiki!
Find all posts by this user
Add Thank You Quote this message in a reply
12-15-2010, 11:17 PM
Post: #2
RE: lundftpd installation, configuration and setup package
What I did was, create the ftp-data/ files with the default user and password and tar that all up. So when you install it for the first time, those files are already there. You just have to make sure you don't pollute the files. I would also do a default/standard SSL cert so it works by default.

Generally, lundftpd is setup to have a root directory somewhere, could even be next to ftp-data/ like ftp-root/, and in there you can make symlinks to everywhere else. Like HDD->SATA_DISK or similar.

I don't think I did that last time though, and just make the FTP root be /opt/sybhttpd/localhost.drives/

If you stick lftpd on a different port you don't have to worry about the default one, but if you want to make a replacement package, you do need to kill the default one first. You can probably use the script you mentioned, or simply kill pureftpd before starting lftpd.
Visit this user's website Find all posts by this user
Add Thank You Quote this message in a reply
[+] 1 user says Thank You to lundman for this post
12-15-2010, 11:55 PM
Post: #3
RE: lundftpd installation, configuration and setup package
Oh, I didn't know you already packaged it up for the NMT, but now I see:
http://www.lundman.net/wiki/index.php/LundFTPD_Download
I'll check that setup and conf file, then!

But I need to revisit the compile; I have no idea if Racestats is included, for instance. Does this indicate that it's there, or what should I look for in the config.status or so?
Code:
ftp> site RACES
200-[ RACES BEGIN ]
.--[RACES]--------------------------------------------------------------------.
| There are currently no races!                                               |
`-----------------------------------------------------------------------------'
200 [ RACES END ]

Thank's for helping out a layman!

Audio, video, disco - I hear, I see, I learn.
Wiki. Wiki? Wiki!
Find all posts by this user
Add Thank You Quote this message in a reply
12-16-2010, 12:32 AM
Post: #4
RE: lundftpd installation, configuration and setup package
I think nearly everything is on by default.

Come to think of it, doing the "ship the ftp-data/ files" idea is not very good. That means if you ever get a new version, you'd lose all your accounts and settings. Better would be to have the install script use ./lundftpd -a to add the first account, if it does not exist...
Visit this user's website Find all posts by this user
Add Thank You Quote this message in a reply
12-16-2010, 12:41 AM (This post was last modified: 12-16-2010 12:45 AM by dc11ab.)
Post: #5
RE: lundftpd installation, configuration and setup package
Hmm, how should I pass arguments? It appears to be an interactive dialogue, so this doesn't work:
./lundftpd -a nmt 1234 UF_ALL *@*.*.*.* q -1 N
I read this on your page:
* Full remote administration features (minus setting user's passwords Smile )

Oh, and is the lftpd.pem found in your package suitable for reusing in a distributed CSI package?

Audio, video, disco - I hear, I see, I learn.
Wiki. Wiki? Wiki!
Find all posts by this user
Add Thank You Quote this message in a reply
12-16-2010, 05:49 AM (This post was last modified: 12-16-2010 05:49 AM by lundman.)
Post: #6
RE: lundftpd installation, configuration and setup package
Yeah you can do..

You can do "site adduser" etc, but it does require the very first account. I would possibly try something like:

Code:
# printf "admin\npasswd\nUF_ALL\n*\nq\n-1\nn\n" | ./lundftpd -a

The pem file should be fine, and the passwd entry in features should be updated, it has been added.
Visit this user's website Find all posts by this user
Add Thank You Quote this message in a reply
12-16-2010, 12:45 PM
Post: #7
RE: lundftpd installation, configuration and setup package
That works, I should be able to package version 3.17 in CSI format!

But it will get ugly because I haven't figured out how to handle the first initialization if it already encounters an existing installation, for instance if $INSTALLDIR/ftp-data/users already exist.

Simple idea is to just die with echo "Error: existing installation detected, quitting." && exit 1 but I'm thinking there could be smarter ways to deal with this. I just haven't figured them out Wink


Some random thoughts:
How about if we want to upgrade? If we only upgrade the binary, we might miss some new feature in the lundftpd.conf.
it should at least make a backup of existing conf, and in an ideal world sed and replace current values into the new conf file.

Will a binary upgrade/replacement care less how and what files exist, e.g. what users file contains, or is there a version dependency or something like that to take into account?

Audio, video, disco - I hear, I see, I learn.
Wiki. Wiki? Wiki!
Find all posts by this user
Add Thank You Quote this message in a reply
12-16-2010, 02:13 PM
Post: #8
RE: lundftpd installation, configuration and setup package
The .conf file has not changed much recently. The user file has not either, but there are upgrade features built in. I would not worry too much about those two, if the defaults are sane. You can make special case tests/sed in future install scripts if the conf does change

In the install script, I would do something like

Code:
if [ ! -f ftp-data/users ]; then
   printf "thatstringhere" | ./lundftpd -a
fi

ie, if there is no file called ftp-data/users, add the default user.
Visit this user's website Find all posts by this user
Add Thank You Quote this message in a reply
12-16-2010, 08:45 PM (This post was last modified: 12-16-2010 09:08 PM by dc11ab.)
Post: #9
RE: lundftpd installation, configuration and setup package
I've made a CSI package of LundFTPd-3.17 that appears to work (at least on my setup!).

And I took the liberty to host it on lundman's site Angle
http://www.lundman.net/wiki/images/7/76/...d-3.17.zip

You should be able to "Install from file.." via the CSI. If you don't like that you can simply unzip/untar and install the files as you prefer.

I'd appreciate anyone trying it out as I haven't covered all kinds of tests, I've basically just installed in CSI, connected and transferred a file:
Code:
$ ftp 192.168.1.23 2223
Connected to 192.168.1.23.
220 ----- Networked Media Tank  FTP server (LundFTPD 3.17 build 512 +TLS +LiON Thu Dec 16 20:24:50 2010) ready.
Name (192.168.1.200:cero): nmt
331 Password required for nmt.
Password:
230- [ 1ST LOGIN ]

Welcome, this is your first login!

Do a SITE HELP to get info about the special site commands.

Be sure to check SITE COLOUR and SITE EXTRA

Have fun and upload lots :)

200- [ WALL ]
+------------------------------------------------------------------------------+
+------------------------------------------------------------------------------+
Type SITE WALL <MESSAGE> to post a message.
200-
230 User nmt logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>  put Malmoweather.txt
local: Malmoweather.txt remote: Malmoweather.txt
229 Entering Extended Passive Mode (|||46051|)
150 Opening BINARY mode data connection for Malmoweather.txt.
100% |******************************************************************************|​  1652        4.71 KiB/s    00:00 ETA
226 Transfer complete.
1652 bytes sent in 00:00 (4.56 KiB/s)
ftp>
So the default admin user is created as user: nmt with password: 1234 (just like the default NMT FTP user/pass)
I put the default root share to /share/ and the port to: 2223
(perhaps I should have set /opt/sybhttpd/localhost.drives as default ftp root to make it more flexible?)


From top during idle:
Code:
Mem: 172640K used, 18656K free, 0K shrd, 33680K buff, 71856K cached
CPU:  0.9% usr  2.7% sys  0.0% nic 95.0% idle  0.0% io  0.0% irq  1.1% sirq
Load average: 0.08 0.17 0.22 6/90 21616
  PID  PPID USER     STAT   VSZ %MEM CPU %CPU COMMAND
  578   576 root     S     348m186.4   0  1.9 syb_framework
21605  2465 root     R     3872  2.0   0  0.4 top
(...)
19274     1 root     S     6192  3.2   0  0.0 /share/Apps/lundftpd/lundftpd
19283 19274 root     S     6192  3.2   0  0.0 /share/Apps/lundftpd/lundftpd
19277 19274 root     S     5760  3.0   0  0.0 /share/Apps/lundftpd/lundftpd
Hmm, why does it spawn three processes?

Anyway, when doing a large binary transfer:
Code:
Mem: 187648K used, 3648K free, 0K shrd, 2752K buff, 123552K cached
CPU:  5.7% usr 17.9% sys  0.0% nic 39.2% idle 12.1% io  0.0% irq 24.9% sirq
Load average: 0.44 0.22 0.20 3/90 22212
  PID  PPID USER     STAT   VSZ %MEM CPU %CPU COMMAND
19274     1 root     R     6192  3.2   0 31.4 /share/Apps/lundftpd/lundftpd
I haven't made a comparison to the default NMT pure-FTPd, and I didn't bother with performance tests. EDIT: Note that this is over Wifi using the WN150 dongle (or whatever it's called), so there should be extra cycles accounted for compared to a normal wired connection.


Lundman; if the package is confirmed OK, would you mind adding it to your CSI repository? A little help info for new users in the xml (the one that presents for CSI users), such as the port to connect to etc. probably wouldn't hurt Wink

Audio, video, disco - I hear, I see, I learn.
Wiki. Wiki? Wiki!
Find all posts by this user
Add Thank You Quote this message in a reply
12-16-2010, 11:52 PM
Post: #10
RE: lundftpd installation, configuration and setup package
Yeha I can add it to repository, that's no issue. The reason for 3 process btw, is one is for the connections, one is for file-checking (sfv etc) and one is for dirlistings. That doesn't change, even with more users.

I'll try it out after work too..
Visit this user's website Find all posts by this user
Add Thank You Quote this message in a reply
12-17-2010, 12:03 AM
Post: #11
RE: lundftpd installation, configuration and setup package
Great, thank you!

The conf should really be revisited by someone who actually knows the app...
I think I disabled some/most of the file checking because I was concerned about overall performance. Too worried?

Audio, video, disco - I hear, I see, I learn.
Wiki. Wiki? Wiki!
Find all posts by this user
Add Thank You Quote this message in a reply
12-17-2010, 02:47 AM
Post: #12
RE: lundftpd installation, configuration and setup package
I wouldn't really disable any of the file checking, since it only comes into effect if you upload something of that type (and if you do, you want it checked).

Really, little needs to be changed in the .conf, and indeed, much can be broken by changing too much Smile
Visit this user's website Find all posts by this user
Add Thank You Quote this message in a reply
12-17-2010, 08:03 AM
Post: #13
RE: lundftpd installation, configuration and setup package
In the lundftpd.conf file checking section I see references that doesn't exist on most peoples NMT's unless they have symlinked this themselves or installed vaidyasrs ipkg CSI package:
/usr/local/bin/unarj
/usr/local/bin/gunzip
/usr/local/bin/lha
/usr/local/bin/dmsdiz

And even with ipkg, gunzip was the only one I could find.

I don't think we should enable such checks unless we are certain that the dependencies are in place. Or does LundFTPd handle that gracefully?

And just to verify: INTERNAL means that LundFTPd handles it by itself (built-in routines)?

Audio, video, disco - I hear, I see, I learn.
Wiki. Wiki? Wiki!
Find all posts by this user
Add Thank You Quote this message in a reply
12-17-2010, 08:09 AM
Post: #14
RE: lundftpd installation, configuration and setup package
i cant figure out how to create users, when i try to edit the file it says i dont have permission, and i have no idea how to do it from the pch.
Find all posts by this user
Add Thank You Quote this message in a reply
12-17-2010, 08:30 AM (This post was last modified: 12-17-2010 08:32 AM by dc11ab.)
Post: #15
RE: lundftpd installation, configuration and setup package
You shouldn't edit a file to add users.

I know 2 ways to do user administration:
1. Connect via telnet to the FTP server (as root) and do "manual" user insertion:
# ./lundftpd -a
And follow the steps:
username, password, level (UF_ALL is max) IP-range (only star, for instance: * <enter> q <enter>) ratio (-1 for unlimited)


2. Connect via FTP to the server and issue the SITE command (on my machine that only works with non-capitals: site)
If you don't have telnet or so, I still think you should use a terminal to connect (On Windows: cmd.exe or putty, on Mac: Terminal, on Linux and other *nixes; mostly any shell).

This should take you there
# ftp ip.of.your.nmt 2223
# nmt
# 1234
# site help

The command is:
site ADDUSER <USR> <PW> <IPS>

Example:
site ADDUSER TonyMontana fUAR234!8f *

The last * means that the user can connect from anywhere. If you want to restrict the user to only connect from a certain IP range you can set that.

All user commands:
Code:
|-[ USER RELATED COMMANDS ]----------------------------------------------------|
| USER [USER]              - Show all users, show info about <USER>            |
|+ADDUSER <USR> <PW> <IPS> - Create a new user                                 |
|+DELUSER <USR>            - Delete an existing user                           |
|+RENUSER <USR> <NEW>      - Rename an existing user                           |
|+SETLIMIT <USR> <LDU> <#> - Set user's <login|down|up> limit                  |
|*SETFLAGS <USR> <UF>      - Set user's userflag level                         |
|+SETPASS <USER> <NEWPASS> - Set user's password                               |
|+SETRATIO <USER> <RATIO>  - Set user's ul/dl ratio, -1 = no ratio             |
|+SETIP <USER> <#> <ID@IP> - Set user's ident@ip pattern on entry <#>          |
|*SETCRED <USER> +/-<AMNT> - Set, +add or -remove <AMNT>MB credits from <USER> |
|*KICK <USER>              - Kick user off the server                          |
So if you want to create an admin user with unlimited ratio etc. just issue the commands above!


If you connect via an FTP client, such as FileZilla, some feature a "Send RAW command"-function (or worded similarly). This is where you enter the "site" commands! (capital or not)

Audio, video, disco - I hear, I see, I learn.
Wiki. Wiki? Wiki!
Find all posts by this user
Add Thank You Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [100/200/300/400] Mediatomb on A110 - Installation problems Sharpie1 1 1,125 02-04-2014 10:58 PM
Last Post: camsky
  [200] OPKG - CUPS and DBUS installation problem flegarr 0 537 12-27-2013 10:29 PM
Last Post: flegarr
Question [200] Any hints how to package software for C.S.I/opkg? marmotamarmota 5 1,748 07-17-2013 07:24 PM
Last Post: PedroDelCargo
  [200] Alternative Linux Terminal Utils package with Telnet/SSH/MC/Transmission Roman_V_M 109 64,511 05-19-2013 12:45 PM
Last Post: parpagnas
  [300] csi-lite installation problem DreamT 2 1,153 05-16-2013 01:03 AM
Last Post: jhmiller
  [300] lundftpd - ls time out wumm 1 574 02-26-2013 02:27 PM
Last Post: wumm
  [300] Several Setup Issues i need help with IUnknownI 8 5,662 02-28-2012 09:58 PM
Last Post: chris57
  [200] [Apps] libffi + dev package installed in wrong place KidE79 0 1,412 10-17-2011 12:02 PM
Last Post: KidE79
Thumbsup [200] [Apps] new zlib 1.2.5 devel package available KidE79 0 992 10-12-2011 03:32 PM
Last Post: KidE79
  [200] HOWTO package ipk file KidE79 6 4,257 10-09-2011 01:57 PM
Last Post: KidE79

Forum Jump: