Networking Forums

Networking Forums > Computer Networking > Linux Networking > vsftpd: access network directories possibe?

Reply
Thread Tools Display Modes

vsftpd: access network directories possibe?

 
 
Ohmster
Guest
Posts: n/a

 
      10-27-2006, 02:50 AM
I have a Fedora Core 5 machine on a cablemodem with FQDN. I run vsftpd
for FTP server and apace for a web server. I have quite a few gigs on my
XP machine on the home LAN that I would like to share with people on the
FTP server at times. Rather than copy all of that stuff to the FC5
machine where the vsftpd server is running, I would like to make a link
or mount in the ftp pub directory so that my ftp visitors can follow the
link or enter the mounted cifs XP share and have read access to the files
on my XP machine.

I have the XP share mounted with cifs on the FC5 machine as /mnt/test and
all of the files are fully accessable for reading (XP machine file system
is NTSF), but when I make a symlink to the mounted XP share, vsftpd gives
a permission denied message. I then mounted the XP share again under the
pub directory in the vsftpd home and now the files can be access by
entering the mounted share and the directory list is available and all
the files are displayed as normal. Here is the command:

mount -t cifs -o
credentials=/etc/smbpasswd.cifs,directio,uid=ohmster,gid=ohmster,rw ,dir_m
ode=0755,file_mode=0644,iocharset=utf8 //missy/ohmster_music
/home/ftpsite/pub/test

The problem occurs if I try to download a file. (I am using CuteFTP 4 as
a test on my XP machine, visiting the site by it's FQDN.) The file fails
to download and the FTP client continues to try and download it. Here is
the FTP client output:

COMMAND:> CWD test
250 Directory successfully changed.
COMMAND:> pwd
257 "/pub/test"
COMMAND:> TYPE A
200 Switching to ASCII mode.
STATUS:> Retrieving directory listing...
COMMAND:> PORT 192,168,0,3,9,38
200 PORT command successful. Consider using PASV.
COMMAND:> LIST
150 Here comes the directory listing.
226 Directory send OK.
STATUS:> Received 67051 bytes Ok.
STATUS:> Time: 0:00:01, Efficiency: 65.48 KBytes/s (67051 bytes/s)
STATUS:> Done.
COMMAND:> TYPE I
200 Switching to Binary mode.
STATUS:> Receiving: The Ronnets - Be My Baby.mp3 --> d:\bench\The
Ronnets - Be My Baby.mp3
COMMAND:> PORT 192,168,0,3,9,39
200 PORT command successful. Consider using PASV.
COMMAND:> RETR The Ronnets - Be My Baby.mp3
150 Opening BINARY mode data connection for The Ronnets - Be My
Baby.mp3 (3837330 bytes).
426 Failure writing network stream.
STATUS:> Received 0 bytes, Abnormal termination
STATUS:> Failed to receive The Ronnets - Be My Baby.mp3
STATUS:> Disconnect: Thursday 22:42:48 10-26-2006
STATUS:> Connect: Thursday 22:42:48 10-26-2006
STATUS:> Connecting to ftp.ohmster.com
STATUS:> Connecting to ftp.ohmster.com (ip = 24.127.198.207)
STATUS:> Socket connected. Waiting for welcome message...
220 Welcome to ohmster FTP service.
STATUS:> Connected. Authenticating...
COMMAND:> USER backroom
331 Please specify the password.
COMMAND:> PASS ********
230-This is the ohmster backroom FTP. All sessions are logged.
230 Login successful.
STATUS:> Login successful
COMMAND:> TYPE I
200 Switching to Binary mode.
COMMAND:> pwd
257 "/"
COMMAND:> TYPE A
200 Switching to ASCII mode.
STATUS:> Retrieving directory listing...
COMMAND:> PORT 192,168,0,3,9,41
200 PORT command successful. Consider using PASV.
COMMAND:> LIST
150 Here comes the directory listing.
226 Directory send OK.
STATUS:> Received 127 bytes Ok.
STATUS:> Time: 0:00:01, Efficiency: 0.12 KBytes/s (127 bytes/s)
STATUS:> Done.
COMMAND:> CWD /pub/test
250 Directory successfully changed.
COMMAND:> pwd
257 "/pub/test"
COMMAND:> TYPE A
200 Switching to ASCII mode.
STATUS:> Retrieving directory listing...
COMMAND:> PORT 192,168,0,3,9,42
200 PORT command successful. Consider using PASV.
COMMAND:> LIST
150 Here comes the directory listing.
STATUS:> Received 67051 bytes Ok.
STATUS:> Time: 0:00:01, Efficiency: 65.48 KBytes/s (67051 bytes/s)
226 Directory send OK.
STATUS:> Done.
COMMAND:> TYPE I
200 Switching to Binary mode.
STATUS:> Receiving: The Ronnets - Be My Baby.mp3 --> d:\bench\The
Ronnets - Be My Baby.mp3
COMMAND:> PORT 192,168,0,3,9,43
200 PORT command successful. Consider using PASV.
COMMAND:> RETR The Ronnets - Be My Baby.mp3
150 Opening BINARY mode data connection for The Ronnets - Be My
Baby.mp3 (3837330 bytes).
426 Failure writing network stream.
STATUS:> Received 0 bytes, Abnormal termination
STATUS:> Failed to receive The Ronnets - Be My Baby.mp3
STATUS:> Disconnect: Thursday 22:42:49 10-26-2006

And the FTP client continues to fail the download, reconnect, try to
download again, fail, reconnect, etc.

What is the problem here? Is it possible to make a link or mount in an
FTP pub directory to access and download files from a networked share on
the home LAN? I really want to do this as it makes it not neccessary to
copy gigs of data over to the machine and it is easy to create, move, or
delete a link to control access. Same goes for a mount.

Can anyone shed some light on accessing network shares via FTP to a Linux
machine? Is it possible, and if so, how do you do it? Thanks.

--
~Ohmster
theohmster at comcast dot net
Put "messageforohmster" in message body
to pass my spam filter.
 
Reply With Quote
 
 
 
 
Peter Greff
Guest
Posts: n/a

 
      10-27-2006, 09:03 PM
Hello!

On Thu, 26 Oct 2006 21:50:29 -0500, Ohmster wrote:

> I have a Fedora Core 5 machine on a cablemodem with FQDN. I run vsftpd
> for FTP server and apace for a web server. [...]


You should enable *verbose* logging on the server.
Try "log_ftp_protocol=YES" in the vsftpd config file. That should give you
a clue.

Peter

--
Peter Greff/ Muenster/ Germany
Email: peter dot greff at arcor dot de
 
Reply With Quote
 
Alan_C
Guest
Posts: n/a

 
      10-28-2006, 05:32 AM
Ohmster <notareal@emailaddress.> writes:
<snip>
> I have the XP share mounted with cifs on the FC5 machine as /mnt/test and
> all of the files are fully accessable for reading (XP machine file system
> is NTSF), but when I make a symlink to the mounted XP share, vsftpd gives
> a permission denied message. I then mounted the XP share again


Isn't the --bind option needed when something gets mounted for a 2nd time?

I think it is.

(or maybe I haven't correctly grasped / you unmounted then mounted under ftp)

Yes, vsftp doesn't like symlink nor even other partitions mounted elsewhere
either.

I had a different partition (previously mounted elsewhere, not under the ftp).
I wanted it (this mounted folder) shared to vsftp. The only thing that ended
up working for me was to mount it again (using the --bind option) under the ftp.

I did not unmount it. That is, the (partition mounted to a folder) remained
mounted to its original mount. I then used the --bind option to also mount
that partition again under the ftp. And now those files work with vsftp.

> pub directory in the vsftpd home and now the files can be access by
> entering the mounted share and the directory list is available and all
> the files are displayed as normal. Here is the command:
>
> mount -t cifs -o
> credentials=/etc/smbpasswd.cifs,directio,uid=ohmster,gid=ohmster,rw ,dir_m
> ode=0755,file_mode=0644,iocharset=utf8 //missy/ohmster_music
> /home/ftpsite/pub/test

<snip>

--
Alan.
 
Reply With Quote
 
Ohmster
Guest
Posts: n/a

 
      10-28-2006, 07:43 AM
"Peter Greff" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> You should enable *verbose* logging on the server.
> Try "log_ftp_protocol=YES" in the vsftpd config file. That should give
> you a clue.
>
> Peter


# When enabled, all FTP requests and responses are logged, providing the
xferlog_std_format=YES
log_ftp_protocol=YES

It has been that way, the server still does not follow links.
--
~Ohmster
theohmster at comcast dot net
Put "messageforohmster" in message body
to pass my spam filter.
 
Reply With Quote
 
Ohmster
Guest
Posts: n/a

 
      10-28-2006, 08:25 AM
Alan_C <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> Ohmster <notareal@emailaddress.> writes:
> <snip>
>> I have the XP share mounted with cifs on the FC5 machine as /mnt/test
>> and all of the files are fully accessable for reading (XP machine
>> file system is NTSF), but when I make a symlink to the mounted XP
>> share, vsftpd gives a permission denied message. I then mounted the
>> XP share again

>
> Isn't the --bind option needed when something gets mounted for a 2nd
> time?
>
> I think it is.


I was able to do that, mount it with the --bind tag and mount it again,
but I had no problem with mounting it twice without the bind anyway. I
did it like this:

[root@ohmster pub]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/mapper/VolGroup01-LogVol00 on /mnt/old_sys type ext3 (rw)
/dev/hda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
automount(pid10203) on /net type autofs (rw,fd=4,pgrp=10203,minproto=
2,maxproto=4)
//missy/ohmster_music on /media/ohmster_music type cifs (rw,mand)
[root@ohmster pub]#

[root@ohmster pub]# mount --bind /media/ohmster_music /var/ftp/pub/music
[root@ohmster pub]#

[root@ohmster pub]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/mapper/VolGroup01-LogVol00 on /mnt/old_sys type ext3 (rw)
/dev/hda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
automount(pid10203) on /net type autofs (rw,fd=4,pgrp=10203,minproto=
2,maxproto=4)
//missy/ohmster_music on /media/ohmster_music type cifs (rw,mand)
/media/ohmster_music on /var/ftp/pub/music type none (rw,bind)
[root@ohmster pub]#

But I could have and did mount the same network share again in two
locations in linux by using the "mount -t cifs..." command. "mount --
bind..." allows me to mount an already mounted share from Linux to Linux
again, that is the only difference that I can see between mount and mount
--bind.

> (or maybe I haven't correctly grasped / you unmounted then mounted
> under ftp)
>
> Yes, vsftp doesn't like symlink nor even other partitions mounted
> elsewhere either.
>
> I had a different partition (previously mounted elsewhere, not under
> the ftp). I wanted it (this mounted folder) shared to vsftp. The only
> thing that ended up working for me was to mount it again (using the
> --bind option) under the ftp.
>
> I did not unmount it. That is, the (partition mounted to a folder)
> remained mounted to its original mount. I then used the --bind option
> to also mount that partition again under the ftp. And now those files
> work with vsftp.


The problem is that I am not mounting a partition but a samba share from
another computer with cifs. Although the share is now mounted in more
than one place, you cannot download from it with FTP because it just does
not work. See output from FTP session:

ftp> bin
200 Switching to Binary mode.
ftp> get "Amy Grant-Baby Baby.mp3"
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for Amy Grant-Baby Baby.mp3
(3795172 bytes).
426 Failure writing network stream.
ftp>

That is the problem right there. "Failure writing network stream." This
directory/share is on another machine and FTP will not grab files from
another machine like that. I can see and list files all day:

ftp> ls -la
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
drwxrwxrwx 1 0 0 0 Jan 26 2005 .
drwxrwxrwx 1 0 0 0 May 09 22:47 ..
-rwxrwSrwt 1 0 0 2777 Jan 26 2005 AlbumArtSmall.jpg
-rwxrwSrwt 1 0 0 10635 Jan 26 2005 AlbumArt_
{C70FDEE0-4D56-490A-A3C8-EA8AC8AE52B2}_Large.jpg
-rwxrwSrwt 1 0 0 2777 Jan 26 2005 AlbumArt_
{C70FDEE0-4D56-490A-A3C8-EA8AC8AE52B2}_Small.jpg
-rwxrwSrwt 1 0 0 3795172 Feb 05 2005 Amy Grant-Baby
Baby.mp3
-rwxrwSrwt 1 0 0 3831073 Feb 05 2005 Amy Grant-Good
for Me.mp3
-rwxrwSrwt 1 0 0 4810352 Feb 05 2005 Amy Grant-I Will
Remember You.mp3
-rwxrwSrwt 1 0 0 10635 Jan 26 2005 Folder.jpg
-rwxrwSrwt 1 0 0 10752 Sep 24 2002 Thumbs.db
-rwxrwSrwt 1 0 0 356 Jan 26 2005 desktop.ini
226 Directory send OK.
ftp: 883 bytes received in 0.00Seconds 883000.00Kbytes/sec.
ftp>

But cannot "get" any files when they are mounted as a network share.
Maybe I did not make that point?

[snip]

Can anyone tell me how to make a link in the ftp pub directory to a share
on a network computer and then have it accessible from an ftp connection,
for downloading files as well as listing them? Thanks.

--
~Ohmster
theohmster at comcast dot net
Put "messageforohmster" in message body
to pass my spam filter.
 
Reply With Quote
 
Ohmster
Guest
Posts: n/a

 
      10-28-2006, 08:48 AM
Ohmster <notareal@emailaddress.> wrote in
news:Xns986A2CEB9719DMyBigKitty@216.196.97.131:

> Can anyone tell me how to make a link in the ftp pub directory to a
> share on a network computer and then have it accessible from an ftp
> connection, for downloading files as well as listing them? Thanks.
>


The answer can be found on this page:
http://stuff.mit.edu/afs/sipb/machin...ftpd-1.2.2/FAQ

Q) Help! I'm getting the error "426 Failure writing network stream." on
downloads.
A) You shouldn't see this with v1.2.1 or newer versions of vsftpd. Older
versions of vsftpd can give this error if the user tries to download
something from an unusual filesystem (e.g. FAT), which don't support
performance features used by vsftpd. With vsftpd-1.1.3 and newer there is a
confif workaround, use_sendfile=NO.

I added the use_sendfile=NO to my vsftpd.conf file, restarted xinetd, and
now it works.
--
~Ohmster
theohmster at comcast dot net
Put "messageforohmster" in message body
to pass my spam filter.
 
Reply With Quote
 
Peter Greff
Guest
Posts: n/a

 
      10-28-2006, 02:39 PM
On Sat, 28 Oct 2006 02:43:43 -0500, Ohmster wrote:

> "Peter Greff" <(E-Mail Removed)> wrote in
> news:(E-Mail Removed):
>
>> You should enable *verbose* logging on the server.
>> Try "log_ftp_protocol=YES" in the vsftpd config file. That should give
>> you a clue.
>>
>> Peter

>
> # When enabled, all FTP requests and responses are logged, providing the
> xferlog_std_format=YES
> log_ftp_protocol=YES
>
> It has been that way, the server still does not follow links.


You misunderstood me. The mentioned setting will not solve your problem,
but will tell vsftpd to give more detailed information in the *log file*,
so you'll be able to see what's going wrong. The output of the *server* is
important not the client's one. As I derive from your last posting, you
have already solved your problem, so you can set "log_ftp_protocol=NO" to
safe some diskspace and system resources. You can turn it on again if you
encounter the next problem. See "man vsftpd.conf" for further details.

Regards
Peter

--
Peter Greff/ Muenster/ Germany
Email: peter dot greff at arcor dot de
 
Reply With Quote
 
Ohmster
Guest
Posts: n/a

 
      10-28-2006, 06:07 PM
"Peter Greff" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> You misunderstood me. The mentioned setting will not solve your
> problem, but will tell vsftpd to give more detailed information in the
> *log file*, so you'll be able to see what's going wrong. The output of
> the *server* is important not the client's one. As I derive from your
> last posting, you have already solved your problem, so you can set
> "log_ftp_protocol=NO" to safe some diskspace and system resources. You
> can turn it on again if you encounter the next problem. See "man
> vsftpd.conf" for further details.
>
> Regards
> Peter


Yes, that makes good sense. Thank you Peter.

--
~Ohmster
theohmster at comcast dot net
Put "messageforohmster" in message body
to pass my spam filter.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Network shares for home directories Andrew E Chapman Windows Networking 10 08-26-2008 07:18 PM
IIS virtual directories danflip Windows Networking 0 06-05-2007 11:01 PM
home directories roshak31 Windows Networking 2 11-06-2006 01:34 AM
vsftpd with ssl - vsftpd.user_list not working shaped Linux Networking 0 01-31-2006 07:04 PM
vsftpd user access (newbie) josh lynch Linux Networking 0 10-27-2003 03:05 AM



1 2 3 4 5 6 7 8 9 10 11