You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ftpserver-users@mina.apache.org by Nilesh Apte <ni...@gmail.com> on 2011/12/15 07:53:15 UTC

Accessing Files from other users home folder?

Hi:

Can a ftp user access a file from other ftp users' home directory (or 
sub directory)?

For example,

1. UserA has his home directory as /home/UserA
2. UserB has his home directory as /home/UserB

3. UserA has a file at following folder location, 
*/home/UserA/documents/test.txt*

4. When UserB connect to apache ftp server, he will see "/" (which maps 
to /home/UserB) as his root directory.
5. Can UserB issue "*GET /home/UserA/documents/test.txt*" to retrieve 
the file?

I tried "running ftp server stand alone in 5 minutes" link, and this 
seems to be not supported out of the box.
I get "550 ... : No such file or directory" error.

What is the recommended/best way to share files between various ftp users?

Thanks,
Nilesh.


Re: Accessing Files from other users home folder?

Posted by Nilesh Apte <ni...@gmail.com>.
Hi Sam:

The example snippet uses  in memory file system (ram://). I wanted to 
use "file://" protocol for my use, so I used following lines of code to 
set the "root" for my file system.
------------
// Create FileSystem Factory (VFS)
VfsFileSystemFactory fsFactory = new VfsFileSystemFactory();
fsFactory.getAuthenticator().setVfsType("virtual");
fsFactory.getAuthenticator().setFactory(fileSystemMgrFactory);
fsFactory.getAuthenticator().*setVfsRoot("file:///C:://Temp");*

// Prepare Root Folder
FileObject rootDir = fsMgr.*resolveFile("file:///C://Temp");*
fsMgr.createVirtualFileSystem(rootDir);
-------------
You can replace "c://temp" to any appropriate folder on your system.

Further, the users' home directories can be set with respect to the root 
directory (using variable like ${user}).

Hope this helps.

Thanks,
Nilesh.

On 1/7/2012 1:29 PM, Sam Mizanin wrote:
> Hey Nilesh,
>
> That is great. But i lost on the part where you said that you replaced "ram" with "file". Can you tell me what did u do in more detail if that's not a problem? I tried this VFS bridge for sometime but was unsuccessfull. I later on configured my own FileSystemView which seemed to be much easier.
>
> Cheers,
> Sam
>
>
> ________________________________
>   From: Nilesh Apte<ni...@gmail.com>
> To: ftpserver-users@mina.apache.org
> Sent: Friday, 6 January 2012, 16:55
> Subject: Re: Accessing Files from other users home folder?
>
> Hi Sam:
>
> Following code snippet helped me. I modified it to use "file" protocol
> instead of "ram" mentioned in the snippet.
> http://snipt.org/kpomo/
> Found this posted by someone on this mailing list.
>
> Thanks,
> Nilesh.
>
> On 1/5/2012 10:54 PM, Sam Mizanin wrote:
>> Hey Nilesh,
>>
>> I would like to know how did u embed the VFS Ftpserver bridge with ApacheFtp?
>>
>> Cheers,
>> Sam
>>
>>
>> ________________________________
>>     From: Nilesh Apte<ni...@gmail.com>
>> To: ftpserver-users@mina.apache.org
>> Sent: Thursday, 5 January 2012, 11:42
>> Subject: Re: Accessing Files from other users home folder?
>>
>> Hi David:
>>
>> Thanks for the suggestions. Sorry for not replying earlier but it took
>> me a while to attempt the VFS thing.
>> For now I think VFS FTPServer Bridge will do it for me. It (The bridge)
>> allows you to set "root directory" for the virtual file system, which
>> can be parent to all users' home directories.
>>
>> Thanks to you and Gary for the pointers.
>> Nilesh.
>>
>> On 12/15/2011 7:43 PM, David Latorre wrote:
>>> Hello,
>>>
>>>       You can use symbolic links as gary bell suggested.
>>>
>>>       Another option is that you  replace our default  FileSystem implementation
>>> with the one provided by the "VFS Utils Project", VFS FTPServer Bridge
>>>
>>>      http://vfs-utils.sourceforge.net/ftpserver/index.html
>>>
>>>
>>> If I'm not wrong, in one of its operation modes,  you are not restricted to
>>> the user's home directory.
>>>
>>>
>>>
>>> You can always develop your own 'Filesystem' implementation :-)
>>>
>>>
>>>
>>>
>>> 2011/12/15 Nilesh Apte<ni...@gmail.com>
>>>
>>>> Hi:
>>>>
>>>> Can a ftp user access a file from other ftp users' home directory (or sub
>>>> directory)?
>>>>
>>>> For example,
>>>>
>>>> 1. UserA has his home directory as /home/UserA
>>>> 2. UserB has his home directory as /home/UserB
>>>>
>>>> 3. UserA has a file at following folder location,
>>>> */home/UserA/documents/test.**txt*
>>>>
>>>> 4. When UserB connect to apache ftp server, he will see "/" (which maps to
>>>> /home/UserB) as his root directory.
>>>> 5. Can UserB issue "*GET /home/UserA/documents/test.**txt*" to retrieve
>>>> the file?
>>>>
>>>> I tried "running ftp server stand alone in 5 minutes" link, and this seems
>>>> to be not supported out of the box.
>>>> I get "550 ... : No such file or directory" error.
>>>>
>>>> What is the recommended/best way to share files between various ftp users?
>>>>
>>>> Thanks,
>>>> Nilesh.
>>>>
>>>>

Re: Accessing Files from other users home folder?

Posted by Sam Mizanin <sa...@yahoo.com>.
Hey Nilesh,

That is great. But i lost on the part where you said that you replaced "ram" with "file". Can you tell me what did u do in more detail if that's not a problem? I tried this VFS bridge for sometime but was unsuccessfull. I later on configured my own FileSystemView which seemed to be much easier.

Cheers,
Sam


________________________________
 From: Nilesh Apte <ni...@gmail.com>
To: ftpserver-users@mina.apache.org 
Sent: Friday, 6 January 2012, 16:55
Subject: Re: Accessing Files from other users home folder?
 
Hi Sam:

Following code snippet helped me. I modified it to use "file" protocol 
instead of "ram" mentioned in the snippet.
http://snipt.org/kpomo/
Found this posted by someone on this mailing list.

Thanks,
Nilesh.

On 1/5/2012 10:54 PM, Sam Mizanin wrote:
> Hey Nilesh,
>
> I would like to know how did u embed the VFS Ftpserver bridge with ApacheFtp?
>
> Cheers,
> Sam
>
>
> ________________________________
>   From: Nilesh Apte<ni...@gmail.com>
> To: ftpserver-users@mina.apache.org
> Sent: Thursday, 5 January 2012, 11:42
> Subject: Re: Accessing Files from other users home folder?
>
> Hi David:
>
> Thanks for the suggestions. Sorry for not replying earlier but it took
> me a while to attempt the VFS thing.
> For now I think VFS FTPServer Bridge will do it for me. It (The bridge)
> allows you to set "root directory" for the virtual file system, which
> can be parent to all users' home directories.
>
> Thanks to you and Gary for the pointers.
> Nilesh.
>
> On 12/15/2011 7:43 PM, David Latorre wrote:
>> Hello,
>>
>>     You can use symbolic links as gary bell suggested.
>>
>>     Another option is that you  replace our default  FileSystem implementation
>> with the one provided by the "VFS Utils Project", VFS FTPServer Bridge
>>
>>    http://vfs-utils.sourceforge.net/ftpserver/index.html
>>
>>
>> If I'm not wrong, in one of its operation modes,  you are not restricted to
>> the user's home directory.
>>
>>
>>
>> You can always develop your own 'Filesystem' implementation :-)
>>
>>
>>
>>
>> 2011/12/15 Nilesh Apte<ni...@gmail.com>
>>
>>> Hi:
>>>
>>> Can a ftp user access a file from other ftp users' home directory (or sub
>>> directory)?
>>>
>>> For example,
>>>
>>> 1. UserA has his home directory as /home/UserA
>>> 2. UserB has his home directory as /home/UserB
>>>
>>> 3. UserA has a file at following folder location,
>>> */home/UserA/documents/test.**txt*
>>>
>>> 4. When UserB connect to apache ftp server, he will see "/" (which maps to
>>> /home/UserB) as his root directory.
>>> 5. Can UserB issue "*GET /home/UserA/documents/test.**txt*" to retrieve
>>> the file?
>>>
>>> I tried "running ftp server stand alone in 5 minutes" link, and this seems
>>> to be not supported out of the box.
>>> I get "550 ... : No such file or directory" error.
>>>
>>> What is the recommended/best way to share files between various ftp users?
>>>
>>> Thanks,
>>> Nilesh.
>>>
>>>

Re: Accessing Files from other users home folder?

Posted by Nilesh Apte <ni...@gmail.com>.
Hi Sam:

Following code snippet helped me. I modified it to use "file" protocol 
instead of "ram" mentioned in the snippet.
http://snipt.org/kpomo/
Found this posted by someone on this mailing list.

Thanks,
Nilesh.

On 1/5/2012 10:54 PM, Sam Mizanin wrote:
> Hey Nilesh,
>
> I would like to know how did u embed the VFS Ftpserver bridge with ApacheFtp?
>
> Cheers,
> Sam
>
>
> ________________________________
>   From: Nilesh Apte<ni...@gmail.com>
> To: ftpserver-users@mina.apache.org
> Sent: Thursday, 5 January 2012, 11:42
> Subject: Re: Accessing Files from other users home folder?
>
> Hi David:
>
> Thanks for the suggestions. Sorry for not replying earlier but it took
> me a while to attempt the VFS thing.
> For now I think VFS FTPServer Bridge will do it for me. It (The bridge)
> allows you to set "root directory" for the virtual file system, which
> can be parent to all users' home directories.
>
> Thanks to you and Gary for the pointers.
> Nilesh.
>
> On 12/15/2011 7:43 PM, David Latorre wrote:
>> Hello,
>>
>>     You can use symbolic links as gary bell suggested.
>>
>>     Another option is that you  replace our default  FileSystem implementation
>> with the one provided by the "VFS Utils Project", VFS FTPServer Bridge
>>
>>    http://vfs-utils.sourceforge.net/ftpserver/index.html
>>
>>
>> If I'm not wrong, in one of its operation modes,  you are not restricted to
>> the user's home directory.
>>
>>
>>
>> You can always develop your own 'Filesystem' implementation :-)
>>
>>
>>
>>
>> 2011/12/15 Nilesh Apte<ni...@gmail.com>
>>
>>> Hi:
>>>
>>> Can a ftp user access a file from other ftp users' home directory (or sub
>>> directory)?
>>>
>>> For example,
>>>
>>> 1. UserA has his home directory as /home/UserA
>>> 2. UserB has his home directory as /home/UserB
>>>
>>> 3. UserA has a file at following folder location,
>>> */home/UserA/documents/test.**txt*
>>>
>>> 4. When UserB connect to apache ftp server, he will see "/" (which maps to
>>> /home/UserB) as his root directory.
>>> 5. Can UserB issue "*GET /home/UserA/documents/test.**txt*" to retrieve
>>> the file?
>>>
>>> I tried "running ftp server stand alone in 5 minutes" link, and this seems
>>> to be not supported out of the box.
>>> I get "550 ... : No such file or directory" error.
>>>
>>> What is the recommended/best way to share files between various ftp users?
>>>
>>> Thanks,
>>> Nilesh.
>>>
>>>

Re: Accessing Files from other users home folder?

Posted by Sam Mizanin <sa...@yahoo.com>.
Hey Nilesh,

I would like to know how did u embed the VFS Ftpserver bridge with ApacheFtp?

Cheers,
Sam


________________________________
 From: Nilesh Apte <ni...@gmail.com>
To: ftpserver-users@mina.apache.org 
Sent: Thursday, 5 January 2012, 11:42
Subject: Re: Accessing Files from other users home folder?
 
Hi David:

Thanks for the suggestions. Sorry for not replying earlier but it took 
me a while to attempt the VFS thing.
For now I think VFS FTPServer Bridge will do it for me. It (The bridge) 
allows you to set "root directory" for the virtual file system, which 
can be parent to all users' home directories.

Thanks to you and Gary for the pointers.
Nilesh.

On 12/15/2011 7:43 PM, David Latorre wrote:
> Hello,
>
>   You can use symbolic links as gary bell suggested.
>
>   Another option is that you  replace our default  FileSystem implementation
> with the one provided by the "VFS Utils Project", VFS FTPServer Bridge
>
>  http://vfs-utils.sourceforge.net/ftpserver/index.html
>
>
> If I'm not wrong, in one of its operation modes,  you are not restricted to
> the user's home directory.
>
>
>
> You can always develop your own 'Filesystem' implementation :-)
>
>
>
>
> 2011/12/15 Nilesh Apte<ni...@gmail.com>
>
>> Hi:
>>
>> Can a ftp user access a file from other ftp users' home directory (or sub
>> directory)?
>>
>> For example,
>>
>> 1. UserA has his home directory as /home/UserA
>> 2. UserB has his home directory as /home/UserB
>>
>> 3. UserA has a file at following folder location,
>> */home/UserA/documents/test.**txt*
>>
>> 4. When UserB connect to apache ftp server, he will see "/" (which maps to
>> /home/UserB) as his root directory.
>> 5. Can UserB issue "*GET /home/UserA/documents/test.**txt*" to retrieve
>> the file?
>>
>> I tried "running ftp server stand alone in 5 minutes" link, and this seems
>> to be not supported out of the box.
>> I get "550 ... : No such file or directory" error.
>>
>> What is the recommended/best way to share files between various ftp users?
>>
>> Thanks,
>> Nilesh.
>>
>>

Re: Accessing Files from other users home folder?

Posted by Nilesh Apte <ni...@gmail.com>.
Hi David:

Thanks for the suggestions. Sorry for not replying earlier but it took 
me a while to attempt the VFS thing.
For now I think VFS FTPServer Bridge will do it for me. It (The bridge) 
allows you to set "root directory" for the virtual file system, which 
can be parent to all users' home directories.

Thanks to you and Gary for the pointers.
Nilesh.

On 12/15/2011 7:43 PM, David Latorre wrote:
> Hello,
>
>   You can use symbolic links as gary bell suggested.
>
>   Another option is that you  replace our default  FileSystem implementation
> with the one provided by the "VFS Utils Project", VFS FTPServer Bridge
>
>   http://vfs-utils.sourceforge.net/ftpserver/index.html
>
>
> If I'm not wrong, in one of its operation modes,  you are not restricted to
> the user's home directory.
>
>
>
> You can always develop your own 'Filesystem' implementation :-)
>
>
>
>
> 2011/12/15 Nilesh Apte<ni...@gmail.com>
>
>> Hi:
>>
>> Can a ftp user access a file from other ftp users' home directory (or sub
>> directory)?
>>
>> For example,
>>
>> 1. UserA has his home directory as /home/UserA
>> 2. UserB has his home directory as /home/UserB
>>
>> 3. UserA has a file at following folder location,
>> */home/UserA/documents/test.**txt*
>>
>> 4. When UserB connect to apache ftp server, he will see "/" (which maps to
>> /home/UserB) as his root directory.
>> 5. Can UserB issue "*GET /home/UserA/documents/test.**txt*" to retrieve
>> the file?
>>
>> I tried "running ftp server stand alone in 5 minutes" link, and this seems
>> to be not supported out of the box.
>> I get "550 ... : No such file or directory" error.
>>
>> What is the recommended/best way to share files between various ftp users?
>>
>> Thanks,
>> Nilesh.
>>
>>

Re: Accessing Files from other users home folder?

Posted by David Latorre <dv...@gmail.com>.
Hello,

 You can use symbolic links as gary bell suggested.

 Another option is that you  replace our default  FileSystem implementation
with the one provided by the "VFS Utils Project", VFS FTPServer Bridge

 http://vfs-utils.sourceforge.net/ftpserver/index.html


If I'm not wrong, in one of its operation modes,  you are not restricted to
the user's home directory.



You can always develop your own 'Filesystem' implementation :-)




2011/12/15 Nilesh Apte <ni...@gmail.com>

> Hi:
>
> Can a ftp user access a file from other ftp users' home directory (or sub
> directory)?
>
> For example,
>
> 1. UserA has his home directory as /home/UserA
> 2. UserB has his home directory as /home/UserB
>
> 3. UserA has a file at following folder location,
> */home/UserA/documents/test.**txt*
>
> 4. When UserB connect to apache ftp server, he will see "/" (which maps to
> /home/UserB) as his root directory.
> 5. Can UserB issue "*GET /home/UserA/documents/test.**txt*" to retrieve
> the file?
>
> I tried "running ftp server stand alone in 5 minutes" link, and this seems
> to be not supported out of the box.
> I get "550 ... : No such file or directory" error.
>
> What is the recommended/best way to share files between various ftp users?
>
> Thanks,
> Nilesh.
>
>

Re: Accessing Files from other users home folder?

Posted by ga...@aero.bombardier.com.
We use symbolic links to link the same file to more than one user. So the
file actually sits in /files/common/documents/test.txt and is symbolically
linked into /home/userA and /home/userB. For the next version of our code
we intend to implement a custom filesystem that will remove the need for
unix symlinks to achieve the same result.


Best Regards,

Gary Bell




                                                                           
             Nilesh Apte                                                   
             <nilesh.apte13@gm                                             
             ail.com>                                                   To 
                                       "ftpserver-users@mina.apache.org"   
             15/12/2011 06:54          <ft...@mina.apache.org>   
                                                                        cc 
                                                                           
             Please respond to                                     Subject 
             ftpserver-users@m         Accessing Files from other users    
              ina.apache.org           home folder?                        
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hi:

Can a ftp user access a file from other ftp users' home directory (or
sub directory)?

For example,

1. UserA has his home directory as /home/UserA
2. UserB has his home directory as /home/UserB

3. UserA has a file at following folder location,
*/home/UserA/documents/test.txt*

4. When UserB connect to apache ftp server, he will see "/" (which maps
to /home/UserB) as his root directory.
5. Can UserB issue "*GET /home/UserA/documents/test.txt*" to retrieve
the file?

I tried "running ftp server stand alone in 5 minutes" link, and this
seems to be not supported out of the box.
I get "550 ... : No such file or directory" error.

What is the recommended/best way to share files between various ftp users?

Thanks,
Nilesh.