PDA

Bekijk de volledige versie : custom ftp



gratitude182
08-02-2007, 22:10
could somebody tell me how i can set up a custom ftp server on the wl-700?

i have tried to follow this guide:

http://www.macsat.com/macsat/content/view/25/29/

but how do i set up the xinetd? and how do i get the custom ftp started with the rc.local?

would be nice if somebody could help me!

thanks
grat182

kfurge
09-02-2007, 02:03
If you only want to reconfigure the existing ftp server, you don't need to run xinetd. Just add these lines to rc.local:

killall vsftpd
/sbin/vsftpd /opt/etc/vsftpd.conf &

You can copy /etc/vsftpd.conf to /opt/etc/vsftpd.conf and customize as necessary for your setup.

- K.C.

sollie
09-02-2007, 07:17
Thanks Kfurge, this is what i was looking for.

Sollie.

gratitude182
09-02-2007, 12:18
thanks kfurge thats it...

but i have one question:

the vsftpd now starts with the opt/etc/vsftpd.conf

i have copied the original asus vsftpd.conf from etc to opt/etc and i have modified nothing.

but when i start the vsftpd with the opt/etc/vsftpd.conf i get the following error when i connect to the router:

[R] 220 Welcome to the WL700gE FTP service.
[R] USER myusername
[R] /dev/nvram: No such file or directory
[R] 331 Please specify the password.
[R] PASS (hidden)
[R] /dev/nvram: No such file or directory
[R] /dev/nvram: No such file or directory
[R] 230 Login successful.
[R] SYST
[R] 215 UNIX Type: L8
[R] FEAT
[R] 211-Features:
[R] EPRT
[R] EPSV
[R] MDTM
[R] ICNV
[R] PASV
[R] REST STREAM
[R] SIZE
[R] TVFS
[R] 211 End
[R] PWD
[R] 257 "/"
[R] TYPE A
[R] 200 Switching to ASCII mode.
[R] PASV
[R] 227 Entering Passive Mode (192,168,1,1,133,31)
[R] Opening data connection IP: 192.168.1.1 PORT: 34079
[R] LIST -al
[R] 150 Here comes the directory listing.
[R] 226 Transfer done (but failed to open directory).
[R] List Complete: 0 bytes in 0,05 seconds (0,0 KB/s)

does somembody knows a solution?

thanks
grat182

kfurge
10-02-2007, 00:23
The error messages you're seeing are very interesting. A little investigation revealed that Asus has messed a little bit with the base vsftpd source code. They added code to check to see if the router is ubsa mode in a number of places by querying the nvram. For some reason the queries don't seem to be working for you.

I tested a little bit further on my box and vsftpd works OK for me when started as root from the command line as shown.

A few questions come to mind:

Are you starting it as root? If you're starting if from rc.local can you try just starting it from a command line instead and see if it works better?

Finally, it's wierd that it can't find /dev/nvram. Are you running it in a chrooted environment?

- K.C.

gratitude182
10-02-2007, 05:19
thanks for help kfurge.

its started as root... (manually started) but its the same whith the rc.local

631 root 688 S /sbin/vsftpd /opt/etc/vsftpd.conf

what do you mean with that?


Are you starting it as root? If you're starting if from rc.local can you try just starting it from a command line instead and see if it works better?

i have only added the two things in the rc.local

killall vsftpd
/sbin/vsftpd /opt/etc/vsftpd.conf &

i think i have a chrooted enivornment.

2 weeks ago i have changed the permissions in the opt/home/username dir to chmod 755. because dropbear won't worked anymore. (and i hadn't changed the permissions earlier!) now dropbear works but i don't know if i made something wrong....

grat182

sollie
10-02-2007, 10:06
Do this for pasv-mode support (WAN):

Step1: Copy vsftpf conf
"cp /etc/vsftpd.conf /opt/etc"

Step 2: add pasv-mode support to vsftpd.conf
"nano /opt/etc/vsftpd.conf"

Add the following lines to the end of this file:
pasv_enable=YES
pasv_min_port=65000
pasv_max_port=65535
pasv_address=85.145.44.81
(WAN-ip)

Step 3: (re)start vsftpd with the new vsftpd.conf file at boot. Add the following lines to your rc.local file:
#Enable pasv-mode for vsftpd
killall vsftpd
/sbin/vsftpd /opt/etc/vsftpd.conf &

Thats all.

Sollie.

PS: the WAN-ip setting in vsftp.conf breaks pasv-mode support for local users.

kfurge
12-02-2007, 03:00
what do you mean with that?

....

i think i have a chrooted enivornment.

...

2 weeks ago i have changed the permissions in the opt/home/username ... but i don't know if i made something wrong....

grat182

There are subtle differences between starting a program via rc.local and a login shell. The primary difference is the PATH and LD_LIBRARY_PATH environment settings. If the problem disappears when starting from a login command prompt, then you've probably got a problem with one of them.

Regarding the chroot environment, if you haven't gone out of your way to enable it, then you're not running in such an environment. The reason why I asked is because /dev will disappear in a chrooted environment which could explain why the ftpd couldn't find /dev/nvram.

I doubt the permission change to /opt/home/username is in any way related to your problem.

- K.C.

gratitude182
12-02-2007, 08:18
hi kfurge,

could this be the problem with the paths -->

i have the following in the opt/home/username/.profile:



PS1="[\w]$ "
PATH=/opt/sbin:/opt/bin:/sbin:/bin:/usr/sbin
LD_LIBRARY_PATH=/opt/lib:/shares/lib

export PS1 PATH LD_LIBRARY_PATH
export TERMINFO=/opt/share/terminfo
export TERM=vt100



and in the rc.local:



export PATH=/opt/bin:/opt/sbin:${PATH}
export LD_LIBRARY_PATH=/opt/lib:${LD_LIBRARY_PATH}


?

thanks
grat182

gratitude182
15-02-2007, 00:33
i don't know why that is now aslike it is, but when i run "screen" i have following error:


[/]$ screen
/var/run/utmp: No such file or directory


screen works alltough but i don't know why that is now.

grat182

gratitude182
16-05-2007, 09:33
now the trick works (because i deleted some things in the dev/ram)....

but now when i try to connect from wan it won't work cause pasv mode problem (locally everything works right). when i disable the firewall it works also from wan.

i have also tried this in the vsfptd.conf file:

pasv_enable=YES
pasv_min_port=65000
pasv_max_port=65535
pasv_address=85.145.44.81

but no luck.
do i have to made some iptables? if yes, could somebody help me how they should look like?

thanks
grat182

sollie
23-05-2007, 19:18
No,you have to use your own IP adress.

Sollie.

lordu
01-11-2009, 18:48
No,you have to use your own IP adress.

Sollie.

What if you have dynamic IP adress? Can you use the DNS name instead?