Unfortunately no one can be told what fun_plug is - you have to see it for yourself.
You are not logged in.
I set up vsftpd and installed it but I can't figure out how to start it. There really no documentation for it as far as I can tell. If I go to sbin and I try to run it it tells me to run it from inetd but honestly I am not sure how to do that, and my searches on multiple forums lead me back here.
Anyway, In the man pages it says
It is activated by setting listen=YES in /etc/vsftpd.conf.
Direct execution of the vsftpd binary will then launch the FTP service
ready for immediate client connections.
so I did
I went to /ffp/sbin
ran vsftpd
then I get this
"500 OOPS: vsftpd: not configured for standalone, must be started from inetd"
I think I am doing it correctly but obviously I am not.
Ultimately I would like to set it up to run automatically whenever the box is restarted so I guess thats where the initd thing comes in.
Any suggestions?
A Little history
I am not sure if this is the best way to go. I have a DNS-321 with the pureftpd installed on the box from factory, but they don't allow you to change the configs. Every time I reboot the ftp after changing the config for the pure ftp it restores to the original somehow on both shutdown and startup of the ftp server. so this is why I am trying the vsftps. I also have some previous experience with vsftpd on a linux box but there i am able to start it from the /etc/init.d/vsftpd start command the init.d I guess is the same as the initd on ffp...
I want to enable passive mode ftp so that I can access ftp from the web securely "with some sort of ssl or ssh" but lets start unsecurely at first.
Last edited by hectorg (2009-01-26 05:36:17)
Offline
ok I tried that and it just hangs which I believe tells me there is a problem with my config so I will look into that when I get home from work today. I have the same example vsftpd.conf that came with the install except I put the listen=yes shouldn't that work and just be open for anonymous connections by default?
Offline
hectorg wrote:
ok I tried that and it just hangs
I think you need to send it into the background yourself.
vsftpd /ffp/etc/vsftpd.conf >/dev/null 2>&1 </dev/null &
Here's a config I tested:
listen=yes local_enable=yes ftp_username=nobody xferlog_enable=yes vsftpd_log_file=/ffp/var/log/vsftpd.log secure_chroot_dir=/ffp/var/empty
Note that you need to create the secure_chroot_dir manually:
mkdir -p /ffp/var/empty
Offline
ok I got it to work with all your help and it seems I just need to beef up the config to get it to do what I want.
Thanks a million..
By any chance is there a way to make this startup automatically when the box reboots?
I tried making a startup sh script
#!/ffp/bin/sh # PROVIDE: vsftpd # REQUIRE: LOGIN . /ffp/etc/ffp.subr name="vsftpd" command="/ffp/sbin/vsftpd" vsftpd_flags="/ffp/etc/vsftpd.conf >/dev/null 2>&1 </dev/null &" required_files="/ffp/etc/vsftpd.conf" run_rc_command "$1"
but I get
Starting /ffp/sbin/vsftpd /ffp/etc/vsftpd.conf >/dev/null 2>&1 </dev/null &
500 OOPS: vsftpd: too many arguments (I take an optional config file only)
If I remove the >/dev/null 2>&1 </dev/null &
It works but again hangs (it doesnt go to the backgroud)
Last edited by hectorg (2009-01-27 17:39:08)
Offline
hectorg wrote:
It works but again hangs (it doesnt go to the backgroud)
Yes, it's a little difficult. Try creating a custom start command like this:
.. start_cmd="vsftpd_start" vsftpd_start() { proc_start_bg "$command" } ...
For more examples, see start/sshd.sh or start/syslogd.sh (they use proc_start, but not proc_start_bg).
Offline
I cant try it now but is this what It is supposed to look like?
#!/ffp/bin/sh # PROVIDE: vsftpd # REQUIRE: LOGIN . /ffp/etc/ffp.subr name="vsftpd" command="/ffp/sbin/vsftpd" vsftpd_flags="/ffp/etc/vsftpd.conf >/dev/null 2>&1 </dev/null &" required_files="/ffp/etc/vsftpd.conf" start_cmd="vsftpd_start" vsftpd_start() { proc_start_bg "$command" }
I feel there is something missing here. Isnt the $command just using "/ffp/sbin/vsftpd"
Last edited by hectorg (2009-01-27 17:41:03)
Offline
ok this is what I have so far
#!/ffp/bin/sh # PROVIDE: vsftpd # REQUIRE: LOGIN . /ffp/etc/ffp.subr name="vsftpd" command="/ffp/sbin/vsftpd" vsftpd_flags="/ffp/etc/vsftpd.conf" required_files="/ffp/etc/vsftpd.conf" start_cmd="vsftpd_start" vsftpd_start() { proc_start_bg "$command" } run_rc_command "$1"
I guess that should work.
Is there any documentation on this ?
Offline
Great work hectorg!
How about making a wiki page with your install procedure? Things can be pretty hard to find in the forum sometimes...
Offline
No problem here you go hope it helps. I think I got it all but if you have any questions just ask and I will try to help as much as I can.
VSFTPD How TO
Last edited by hectorg (2009-03-16 13:00:07)
Offline
Wow hectorg! What an elaborate page you made! Very impressive.
I actually used your instructions from the forum but this page, I'm sure will be very useful.
BTW, I don't think there is any need to reboot at the end. I didn't anyway.
I took another approach than the userlist that you are using - although I actually started using it - until I realized that I don't exactly know how strong the passwords of the system's users are. Therefore I wanted to only allow a select group of users access to the ftp server.
My scenario is this: A few persons need to share a ftp directory from the Internet.
For security reasons I don't like the userlist as it means that the connection is dropped right after you have provided the username. This can be used (although with a fairly time-comsuming brute force attack) to deduce the available usernames on the system. It is much better that the user (attacker) has to provide both username and password before the connection is cut. This way the attacker won't know whether the username or the password was incorrect and thus it expands the search space immensely.
This is why I have used an approach of a master config file which is very strict (empty local_root dir, no upload, no download, guest account, etc.) and then I have a user_conf dir with a config file per user that relaxes the strict permissions.
I probably should update the wiki page with the details.
Offline
I never thought of that but I guess you are correct. Let me know when you put up the changes on the wiki and I will take a look at how it is implemented. Another thing I do is use a port that noone recognizes as an ftp port. Internally I am using regular port 21 but externally you could use something like 345678 and well that would be another thing an atacker would have to guess.
Offline
I already updated the wiki. And yes, moving services away from the well-known ports tends to make your log files a whole lot shorter!
Offline
hectorg:
it works according to your instructions on the wiki
however i can't start vsftpd via your start script ..
i changed the path to the .conf in the script, but it still does not start
also i am interested in a stop/restart option, but there is not .pid file ;-)
#!/ffp/bin/sh # PROVIDE: vsftpd # REQUIRE: LOGIN . /ffp/etc/ffp.subr name="vsftpd" # command="/ffp/sbin/vsftpd" command="/ffp/sbin/vsftpd" vsftpd_flags="/ffp/etc/vsftpd/vsftpd.conf >/dev/null 2>&1 </dev/null" required_files="/ffp/etc/vsftpd/vsftpd.conf" start_cmd="vsftpd_start" vsftpd_start() { proc_start_bg "$command" }
this command works:
vsftpd /ffp/etc/vsftpd/vsftpd.conf &
Last edited by mastervol (2009-02-07 15:28:05)
Offline
your flags are incorrect I put up the wrong script.
I already updated the wiki
here is what your startup script vsftpd.sh should look like
Sorry about that. I was tired when I wrote it.
#!/ffp/bin/sh # PROVIDE: vsftpd # REQUIRE: LOGIN . /ffp/etc/ffp.subr name="vsftpd" command="/ffp/sbin/vsftpd" vsftpd_flags="/ffp/etc/vsftpd.conf" required_files="/ffp/etc/vsftpd.conf" start_cmd="vsftpd_start" vsftpd_start() { proc_start_bg "$command" } run_rc_command "$1"
Sorry about that. Let me know if that worked out for you.
Last edited by hectorg (2009-02-07 23:50:48)
Offline
I am having trouble getting vsftpd to run. I am a linux n00b and am sure it's a case of PEBKAC, but I'm still hoping someone here might help me.
I have followed the instructions on the howto to the letter. When I go to run vsftpd, using:
vsftpd /ffp/etc/vsftpd.conf >/dev/null 2>&1 </dev/null &
I get no errors and it returns to the command line prompt. But after any input at the prompt, I get an exit notice:
[1]+ Exit 1 vsftpd /ffp/etc/vsftpd.conf > /dev/null 2>&1 < /dev/null
A check with ps or top shows no daemon running. Attempts to ftp in fail. I have verified that all of the relevant files exist. Anyone have any ideas? Your help is greatly appreciated.
Last edited by dilettanti (2009-03-06 05:36:59)
Offline
you sure your config file is correct?
Post it here
I am not sure why you are getting errors. I have this same exact config to the T and it works. What box are you using? Mine is the DNS-321
That code above you stated just puts the job in the backgroud
Try to run that and then FTP without touching the terminal on the nas and see if you could get in. You wont be able to get in if it exits.
Did you put the job in startup? If is no need to start it manually if you rebooted after installing. otherwise I guess the code above is ok.
Another thing is the More Scure section was not added by me and honestly I havent tried it so I would remove anything that you did in that section and give it another try.
Offline
Thansk for the write up Hector,
Please help:
i can't install the package - i get error
"FATAL: /ffp not found in package"
what does this mean?
Offline
i do have funplug installed... that is kinda the strange part? I have setup rsync to backup nightly and that seems ok (did a manual run which is still going).
The error states "ffp not found IN package" - i don't get it - unless the package is corrupted. So i went ahead and tried older packages - came up with the same message...
Offline