Preliminary replacement for gtkftpd FTP server

Stuff that has yet to be sorted into a category.
Post Reply
Message
Author
User avatar
papaschtroumpf
Posts: 250
Joined: Fri 17 Jun 2005, 04:23

Preliminary replacement for gtkftpd FTP server

#1 Post by papaschtroumpf »

I can't get gtkftpd to work properly for me so I started looking for an alternative and decided to use betaftpd.
Despite its name it's not beta software, although it is pretty old. It will this will work for me although I'd like some feedback to make sure we can make it useful for most.
I had to mess with the code because it wouldn't compile under Vector Linux 5 STD, but I finally have it running in puppy.

The advantages first:
- doesn't require inetd or xinetd which is not available in puppy (in fact it won't work with inetd or xinetd)
- small: the executable I have is about 35k uncompressed, the author claims it can be reduced down to 20k although it's with an older compiler.
- fast and memory efficient
- easy to configure (there is no configuration to speak of)
- can be started at power up as a background daemon
- anonymous ftp works

The disadvantages:
- it doesn't have command line options, so if you want a feature it needs to be compiled in, and if it's compiled in it can't be turned off. The biggest feature where I could se this being a problem is with allowing uploads.
For my own use I want to allow uploads so I will compile it with uploads enabled, but that means that you can't prevent people from uploading to your server.
- when you log in, the root directory is that user's home directory. If you want to limit access to a particular directory you need to create a user and make that directory the user's home
- it will not let root log in, although I can remove that limitation by changing the program.
- it will not let a user log in that doesnt't have a password. I can probably remove that limitation althoguh my first attemt at doing so failed.
The two points above make sense from a security point of view, however in puppy you are generally the root user and that account doesn't have a passord. In fact passwd doesn't seem to wrok on root or spot.



I'm still playing with this and trying to figure out how it should be configured but I'm thinking about doing the following:


The install script asks you if you want to allow anonymous ftp. if yes, it creates a new user "ftp" with its home directory in /root/ftp (I have been thinking about changing the name of the anonymous user to "rover" in the code :) )

The install script asks if you want to create a passworded user and creates a new user with its home directory under root, for example /root/papaschtroumpf

menu entries in the WM menu: (or maybe a single entry that calls a script with the different options)
- start ftp server
- stop ftp server
- run/don't run at boot
- add user

when you choose any of those you'd get a pop up message that confirms it was started/stopped or would offer to toggle the boot state.
I'm not sure exactly how to write the add user, but basically it would create a new user with a home directory under /root, for example /root/papaschtroumpf


This way you can choose to have anonymous ftp fo everyone, and a few private accounts for your friends. each friend gets their own directory though, so you can't have friend A upload a file and friend B pcik it up, unless they know each other's password or use the anonymous account if it's there.

Personally, the main reason I want an FTP server is to use as a "poor man's Samba" so I only plan to use the anonymous account.


Let me know what you think.
Mandriva LE 2005 user and puppy newbie

User avatar
papaschtroumpf
Posts: 250
Joined: Fri 17 Jun 2005, 04:23

#2 Post by papaschtroumpf »

Here's the current version of the server, although it's subject to change.

EDIT: mozilla couldn't upload the file while running from puppy???? will try again from another machine.
OK I figured it out, I didn't have an extension to the file because I didn't tar.gz it. Well it gave me a chance to test my theory of using FTP as a replacement for Smaba: I opened a browser and used anonyous ftp to retrieve the file from puppypc to the machine I'm using now.


1) place it somewhere (I'm thinking /sbin?)
2) for anonymous FTP create a user called ftp with the home at /root/ftp:
adduser -h /root/ftp ftp
(will prompt you for a password but ftp will ignore it since it's the anonymous account)
3)run the server by clicking on it or on the command line:
./betaftpd &

Logging is not working, I thought I had enabled logginf to /var/log/... I'll look into it. I'm not sure how I feel about logging anyway, since it could be filling RAM with logs when booting from a CD with no HD access.


This is still in the experimental stage, so use at your own risk

Also betaftpd supports shadow passwords but I don't think this version has that option enabled.


Finally I think that I may hack the program has follows:
- allow user "root" to log in
- don't allow user root to log in without a password, however since I puppy root doesnt't have a password, when you try to log in as root, the server will look up a "dummy root user" and try to match the password entered to the password of the dummy user, even though it will share everything in /root
Attachments
betaftpd.tar.gz
experimental - see setup instructions in the post above. I will make a dotpup and/or unleashed once everything is sorted out.
(17.67 KiB) Downloaded 862 times
Last edited by papaschtroumpf on Sun 26 Jun 2005, 09:18, edited 1 time in total.

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#3 Post by Lobster »

8)

I think my medication must be wearing off because I could not find the file - did you teleport it in some unusual manner?

:roll:

I appreciate you are green - but are you related to Papa Smurf? What style of Karate do Smurfs do incidentally? I used to do Mugendo and Mushindo - but I was rubbish - people used to attack me all the time - sometimes even during the class.
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
papaschtroumpf
Posts: 250
Joined: Fri 17 Jun 2005, 04:23

#4 Post by papaschtroumpf »

I had trouble uploading the file because I hadn't tarred and gzipped it. It's there now.

Schtroumpf is French for smurf :wink: Sounds about like what you'd expect too (somewhere short of a sneeze).

I practice the Shotokan style of Karate. They teach you to run if attacked :D


3:45am, time to hit the sack, I'll play with FTP servers later...
Mandriva LE 2005 user and puppy newbie

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

Morizot Firewall

#5 Post by Lobster »

papaschtroumpf wrote: I practice the Shotokan style of Karate. They teach you to run if attacked :D
tee hee - and he ain't joking. I did one Shotokan class and that is indeed what they taught me. Non-lethal and multiple attacker friendly too.

Talking of self defense . . . The Morizot Firewall seems to be very simple and good (it doesn't bother me and I do not bother it) - perhaps worth putting on by default?
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
papaschtroumpf
Posts: 250
Joined: Fri 17 Jun 2005, 04:23

Re: Morizot Firewall

#6 Post by papaschtroumpf »

Lobster wrote: Non-lethal...
We could if we had to... :shock:


Back to the subject. I have now spent more time on an install script and a "Control Center" than on porting the software itself.

The install script install the software, creates the "ftp" user and inserts a menu item in the fvwm95 start menu under "Networking" but not in JWM or iceWM yet.
There is also no uninstall facility.

The item installed in the menu is my homebrewed "control center":

Image

The HELP button does nothing either.

I need to create an html man page since betaftpd doesn't have one.

The compile options I settled on are:
--enabled-upload so that you can upload files to the server
--enabled-xferlog to provide a lof of all transfers. I discovered that if the log file doesn't exist when the program is started, it will not log anything, so that's what I use in my "Control Center" to enable and disable logging.
--enabled-fork the server runs silently in the background, "daemon-style"

The options I decided to not enable are:
--enabled-nonroot allows non-root users to start the server. it seemed somewhat flaky and puppy runs as root most of the time anyway
--enabled-dcache caches the content of the directories so that "ls" commands on the server are faster. Also seemed a little flaky, not updating the list properly. It also made the app larger and use more memory
--enable-message enabled the welcome message / message of the day. I don't care for that deature and the readme says that it's not very intelligent and will display the message every time you display that directory
--enable-shadow puppy doesn't seem to use shadow password, so removing support for it kept the executable smaller
--enable-ascii who does ascii transfers nowaday? transferring text file s in bin mode works just fine.
--enable-stat consumed more memory and more code to to support he STAT command (user statistics?) didn't seem useful in a lightweight server.

I'll upload a tarball shortly for those of you that want to give it a try. Not ready to create a dotpup yet.
Mandriva LE 2005 user and puppy newbie

User avatar
papaschtroumpf
Posts: 250
Joined: Fri 17 Jun 2005, 04:23

Near-final version of replacement for gtkftpd FTP server

#7 Post by papaschtroumpf »

Here's something close to a final version. Let me know what you think.
The safesst way to test this if you're worried about messing up something is to do a mode 2 install so that if something goes wrong, you can reboot and start clean. Not that anything will go wrong :D

I need to do a little more testing of the installation scripts and add support for other WMs and an uninstall function.

When all that is done I intend to make both a dotup and an unleashed.

Barry, what do you need exactly to make a sorcerer package, do you have instructions yet?
Attachments
BetaFTPD-1.tar.gz
unar.zip, cd into it, run installftpd.sh
(20.33 KiB) Downloaded 922 times
Mandriva LE 2005 user and puppy newbie

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#8 Post by BarryK »

Sourcerer, no, but I will upload a "core" package hopefully at the same time as 1.0.4 is released. It will have all the instructions in it.

User avatar
papaschtroumpf
Posts: 250
Joined: Fri 17 Jun 2005, 04:23

#9 Post by papaschtroumpf »

I think I'm statisfied with the final product. Ill definitely be usng it myself.
See therelease thread here: http://www.murga.org/%7Epuppy/viewtopic.php?t=905

Is there a list of PupGets on the Wiki or does everyone else do DotPups?
Mandriva LE 2005 user and puppy newbie

Post Reply