Results 1 to 9 of 9

Thread: stupid ftpd - settings erased

  1. #1

    stupid ftpd - settings erased

    Hi all!
    I just upgraded my router to the latest Oleg Firmware CR5 and I have Samba running and its working great!! I newer thought I could do this with my router

    My problem is with the settings of stupid.ftpd which are stored in the /tmp/stupidftpd.conf file

    This file seems to be overwritten always when the router is restarted. As I have changed the ftp_pub directory to the / this is very annoying. What I do now is always killing stupid_ftpd and then starting it again with
    stupid_ftpd -f stupid_ftpd.conf which I have stored in /usr/local/init

    When i downloaded stupid ftpd from sourceforge the manual says (linux/unix):
    stupid_ftpd looks for the config file in usr/local/stupid_ftpd/stupid_ftpd.conf or something like that but this seems not to be true as I have created this directory and file there but I seems not to be taken...

    What can I do that stupid_ftpd is started always with my configuration file?

    Cheers
    Rainer

  2. #2
    Join Date
    Aug 2004
    Location
    Germany
    Posts
    377
    Hi

    Web Config of the Router creates the config on-the-fly after boot and stores it in ram ( /tmp is filesystem in ram) so it gets deleted when rebooting.
    You have to build something around the post-boot things in olegs firmware to copy your own config from config flash partition into the ram partion i think ...

    Dont wonder where the config lies in the source package you downloadet, this can all be configured at compiletime and so its done in asus .
    My Stuff: WL-500g, Mapower H31x 10GB HD, Philips Webcam Vesta PRO, TerraTec Webcam PRO, USB Hub

  3. #3
    Join Date
    Apr 2004
    Location
    Netherlands
    Posts
    1,308
    Follow these steps:
    - Store the stupid-ftp.conf in '/usr/local'.
    - Add '/sbin/stupid_ftpd -f /usr/local/stupid_ftpd.conf' to '/usr/local/init/post-boot'
    - Disable ftp in the webinterface (if this creates problems with firewall/routing add 'killall stupid-ftp' to '/usr/local/init/post-boot' before the line where you start your own stupid-ftp config)
    - Save changes with 'flashfs save' and 'flashfs commit'
    - Reboot

    This should automate the startup of you custom stupid-ftp config.

    There are other options (e.g. compile the firmware yourself) but these will take more time.

  4. #4
    Wow thanks for the fast reply!
    I was thinking about doing something like that.(killing and restarting stupid ftpd) at boot time. Just wanted to make sure there is no "proper" other way to do it

  5. #5
    Join Date
    Apr 2004
    Location
    Netherlands
    Posts
    1,308
    Quote Originally Posted by rdk
    Wow thanks for the fast reply!
    I was thinking about doing something like that.(killing and restarting stupid ftpd) at boot time. Just wanted to make sure there is no "proper" other way to do it
    Well, I can't say its the most beautiful way to accomplish this...

    You should try to disable the ftp function through webinterface and add an iptables rule to /usr/local/init/post-firewall to enable access from WAN like this:

    iptables -A INPUT -p tcp --dport 21 --syn -j ACCEPT

    In my view this should work AND is an elegant solution.
    Last edited by Styno; 19-08-2004 at 17:50.

  6. #6

    Smile

    Hmm its strange i have added something like this in the post-firewall script (when I was searching the forum for enabling wan ssh and ftp access) But I have some troubles dealing with iptables...

    What worked for me:
    In the webinterface's NAT settings i just added a forwarding rule:
    192.168.1.1 port 21 and for ssh 192.168.1.1 port 22 and this works for me without having to deal with iptables and post-firewall script...

  7. #7
    Join Date
    Apr 2004
    Location
    Netherlands
    Posts
    1,308
    So, problem fixed?

  8. #8
    Yes everything working now !! Thanks

  9. #9
    Looking at Oleg's page about flashfs and tweaking the boot sequence, there's another funky trick you can play:

    % cp /init/ftpdserver /usr/local/init/
    % cat >/usr/local/init/pre-boot
    #!/bin/sh
    mount -o bind /usr/local/init/ftpdserver /init/ftpdserver
    ^D
    % chmod +x /usr/local/init/pre-boot
    [... edit /usr/local/init/ftpdserver to do what you want it to...]
    % flashfs save
    % flashfs commit

    I've just used this neat trick to change /init/rc.prnsvr so it doesn't start lpd and infosrv (and the p910nd for the LPT port) any more, since I don't use those services.
    The mount "-o bind" argument is the trick to replacing a read-only file with a read-write one if your own choosing.

Similar Threads

  1. wl500g deluxe - ftpd-topfield
    By Reinder in forum WL-500g Custom Development
    Replies: 8
    Last Post: 25-01-2008, 15:49
  2. stupid-ftp 2GB limit?
    By spank_santa in forum WL-HDD Custom Development
    Replies: 1
    Last Post: 08-09-2005, 10:31
  3. stupid man
    By modnet25 in forum WL-500g Q&A
    Replies: 4
    Last Post: 28-02-2005, 00:02
  4. FTP - Make permanent changes to stupid-ftpd.conf
    By Bertie in forum WL-500g Q&A
    Replies: 7
    Last Post: 29-11-2004, 19:44

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •