PDA

Bekijk de volledige versie : some problems with ftp/samba/hdd



Rui_Carlos
09-06-2007, 17:17
I tried configure ftp and samba using the web interface, but didn't work.
So I tried configure with ssh access.
Now samba is working, but if I disable ftp server in the web interface I can't mount the usb hdd. How can I solve this?

I also tried install vsftpd to configure a ftp server, but when I execute the "ipkg install" comand I get this error:


[admin@router /]$ ipkg install vsftpd
Installing vsftpd (2.0.1-7) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/vsftpd_2.0.1-7_mipsel.ipk
Configuring vsftpd
You'll need to add line like
echo "ftp stream tcp nowait root /opt/sbin/vsftpd /opt/etc/vsftpd.conf" >>/etc/inetd.conf
to your /unslung/rc.xinetd file -- see the wiki at http://www.nslu2-linux.org for more info
mkdir: Cannot create directory `/usr/share/': Read-only file system
Successfully terminated.

Any suggestion to solve this?

Maybe I could use stupid-ftpd but it also doesn't work.


[admin@router /]$ stupid-ftpd
Cannot find /tmp/stupid-ftpd.conf.
Make sure it's available.

Any help :confused:

(sorry by bad english)

KGy
09-06-2007, 21:19
Hi. Sorry my english.

You can use stupid-ftpd, if you edit stupid-ftpd.conf file (/opt/etc/stupid-ftpd.conf) Look google: "stupid-ftpd.conf" for info to edit this file.
Use your conf file: stupid-ftpd -f /opt/etc/stupid-ftpd.conf

But vsftpd a better (if you expert)

George

cps
10-06-2007, 08:30
I tried configure ftp and samba using the web interface, but didn't work.
So I tried configure with ssh access.
Now samba is working, but if I disable ftp server in the web interface I can't mount the usb hdd. How can I solve this?

I also tried install vsftpd to configure a ftp server, but when I execute the "ipkg install" comand I get this error:


[admin@router /]$ ipkg install vsftpd
Installing vsftpd (2.0.1-7) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/unslung/wl500g/vsftpd_2.0.1-7_mipsel.ipk
Configuring vsftpd
You'll need to add line like
echo "ftp stream tcp nowait root /opt/sbin/vsftpd /opt/etc/vsftpd.conf" >>/etc/inetd.conf
to your /unslung/rc.xinetd file -- see the wiki at http://www.nslu2-linux.org for more info
mkdir: Cannot create directory `/usr/share/': Read-only file system
Successfully terminated.

Any suggestion to solve this?

Maybe I could use stupid-ftpd but it also doesn't work.


[admin@router /]$ stupid-ftpd
Cannot find /tmp/stupid-ftpd.conf.
Make sure it's available.

Any help :confused:

(sorry by bad english)

1) "Cannot create directory `/usr/share/': Read-only file system" - your usb disk mounted as ready-only. It means that your USB-HDD (or flash or whatever) have NTFS file system and router cannot mount it as read-write. Mountig in RW mode filesystem with your data in router is not very good idea, because of complexity of file handling under ext3 file systems.

2) Stupid-ftp is beeing enabled through web-interface. USB Application -> Ftp Server

3) As for myself, I found the best way to solve my problem with home_ftp_server is to have my usb-disk partitioned like this:
-first primary partition ext3, about 10 Gb
-second primary partition ntfs. system mounts it as readonly, so I don't worry about any data loss while disk is under BusyBox Linux of router.

I suggest you to search the forum about how to install and configure router from the scratch.

Rui_Carlos
10-06-2007, 09:09
1) "Cannot create directory `/usr/share/': Read-only file system" - your usb disk mounted as ready-only. It means that your USB-HDD (or flash or whatever) have NTFS file system and router cannot mount it as read-write. Mountig in RW mode filesystem with your data in router is not very good idea, because of complexity of file handling under ext3 file systems.


No, the filesystem is ext3. The directory '/usr' is not in usb hdd.



2) Stupid-ftp is beeing enabled through web-interface. USB Application -> Ftp Server

I tried use the web interface, but it doesn't work. Now I made the file 'stupid-ftpd.conf' and a S**stupid-ftpd manualy and the server is working.


I still don't understand why if I disable the ftp server in the web interface I can't mount the usb hdd.



thanks for your help.

cps
11-06-2007, 07:53
No, the filesystem is ext3. The directory '/usr' is not in usb hdd.

I tried use the web interface, but it doesn't work. Now I made the file 'stupid-ftpd.conf' and a S**stupid-ftpd manualy and the server is working.

I still don't understand why if I disable the ftp server in the web interface I can't mount the usb hdd.

thanks for your help.

Well, the main problem with stupid-ftpd is that its been really stupid. If you disable all of usb_applications in web-interface, then automount procedure will not work and you have to mount disks manually.

There are 4 commands that you should add to /usr/local/sbin/post-boot (if this file is not exist then create it)to enable your disk for mounting:
#!/bin/sh
insmod scsi_mod
insmod sd_mod
insmod usb-storage

After that you should create or update /usr/local/sbin/post-mount. Here is mine:
#!/bin/sh
mount -o remount,sync,rw,noatime /tmp/harddisk/
mount -o bind /tmp/harddisk/opt /opt
mount -o bind /tmp/harddisk/part1 /opt/ftp/stuff
sleep 1
/opt/sbin/vsftpd /opt/etc/vsftpd.conf

And update create or update /usr/local/sbin/post-firewall. Mine is like this:
#!/bin/sh
iptables -D INPUT -j DROP
iptables -A INPUT -p tcp --dport 21 -j ACCEPT
iptables -A INPUT -j DROP

Make all these files executable by entering:
chmod +x /usr/local/sbin/*

Next step is to save all these files in /usr/local/sbin/ . For this you should enter 3 commands:
flashfs save
flashfs commit
flashfs enable

You could search forum for more detailed information, because it's just the beginning. Good luck.

Rui_Carlos
12-06-2007, 14:31
Where should I mount the usb-hdd, at '/tmp/harddisk' or '/opt' ?
(now, it is mount at '/opt')

cps
12-06-2007, 20:05
Where should I mount the usb-hdd, at '/tmp/harddisk' or '/opt' ?
(now, it is mount at '/opt')

If you got all usb applications turned off, then you have to mount everything by your own.

Here are my configuration files. I have turned off all usb applications (no ftp, no samba. etc).

/usr/local/sbin/post-boot:
------------begin-------------
#!/bin/sh
insmod scsi_mod
insmod sd_mod
insmod usb-storage

mkdir /tmp/harddisk
mount /dev/discs/disc0/part1 /tmp/harddisk
mount /tmp/harddisk/opt /opt
mount /dev/discs/disc0/part2 /opt/ftp/stuff
i=0
while [ $i -le 30 ]
do
if [ -d /opt/etc ]
then
break
fi
sleep 1
i='expr $i + 1'
done

/opt/etc/init.d/rc.unslung

export TERMINFO="/opt/share/terminfo"
export TERM="linux"
------------end-------------

/usr/local/sbin/post-mount:
------------begin-------------
#!/bin/sh
/opt/sbin/vsftpd /opt/etc/vsftpd.conf
------------end-------------

As you can see, I am mounting everything in post-boot file.