SlimFTPd: Config Anonymous: Difference between revisions
Upazixorys (talk | contribs) No edit summary |
m (Reverted edits by Upazixorys (Talk); changed back to last version by Ric) |
||
Line 1: | Line 1: | ||
<span id="top"></span> | |||
<div style="padding:0;margin:0; border-bottom:3px inset #000000"> | |||
{| | {| | ||
| [[Image:uc_small_logo.gif | MPG UniCenter]] || | | [[Image:uc_small_logo.gif | MPG UniCenter]] || | ||
Line 13: | Line 12: | ||
|} | |} | ||
</div> | |||
{| cellpadding= | {| cellpadding="2" | ||
| | | | ||
__TOC__ | __TOC__ | ||
Line 22: | Line 21: | ||
For the majority of Internet users, FTP’s real power is transparent. At the click of a link, they can initiate an FTP server download; these users are anonymous never needing to provide a user name and password. | For the majority of Internet users, FTP’s real power is transparent. At the click of a link, they can initiate an FTP server download; these users are anonymous never needing to provide a user name and password. | ||
{|width= | {|width="80%" style="background:#333333" cellpadding="4" cellspacing="1" | ||
|-style= | |-style="background:#eeeeee" | ||
| | | | ||
This part of the tutorial covers using SlimFTPd for anonymous user access. It is extremely easy to set up, provide a user profile with user name set to “'''anonymous'''” with a '''blank password''' and restrict '''access''' to '''read''' as shown to the right. | This part of the tutorial covers using SlimFTPd for anonymous user access. It is extremely easy to set up, provide a user profile with user name set to “'''anonymous'''” with a '''blank password''' and restrict '''access''' to '''read''' as shown to the right. | ||
| | | | ||
''' | '''<User "anonymous">''' <br> | ||
'''& | ''' Password ""'''<br> | ||
& | Mount / Some folder <br> | ||
'''& | ''' Deny /All'''<br> | ||
'''& | ''' Allow / Read'''<br> | ||
''' | '''</User>''' | ||
|} | |} | ||
Line 40: | Line 39: | ||
I have a folder containing wave music files and would like to make these downloadable from a web page. The anonymous user profile has the following format: | I have a folder containing wave music files and would like to make these downloadable from a web page. The anonymous user profile has the following format: | ||
{|width= | {|width="80%" style="background:#333333" cellpadding="4" cellspacing="1" | ||
|-style= | |-style="background:#eeeeee" | ||
| | | | ||
Add the user profile on the right to the end of SlimFTPd’s configuration file. | Add the user profile on the right to the end of SlimFTPd’s configuration file. | ||
Line 47: | Line 46: | ||
C:\uc_slimftpd_tutorial\'''slimftpd.conf''' | C:\uc_slimftpd_tutorial\'''slimftpd.conf''' | ||
| | | | ||
<User "'''anonymous'''"><br> | |||
& | Password ""<br> | ||
& | Mount / '''C:/uc_slimftpd_tutorial/uc_tskill/wav'''<br> | ||
& | Deny /All<br> | ||
& | Allow / '''Read'''<br> | ||
</User> | |||
|} | |} | ||
# Stop (uc_kill_process.bat) and re-start SlimFTPd (SlimFTPd.exe) this forces configuration changes to take effect. | # Stop (uc_kill_process.bat) and re-start SlimFTPd (SlimFTPd.exe) this forces configuration changes to take effect. | ||
# Type ''' | # Type '''<nowiki>ftp://localhost</nowiki>''' into your browser address bar. | ||
# You will receive a '''550-error''' list permission denied, not surprising because '''allow''' was set to '''read''' only. | # You will receive a '''550-error''' list permission denied, not surprising because '''allow''' was set to '''read''' only. | ||
Line 65: | Line 64: | ||
All test pages are contained in folder C:\uc_slimftpd_tutorial\uc_tskill hence no need to create these. To run and html page double click on its file name it will be displayed in your browser. | All test pages are contained in folder C:\uc_slimftpd_tutorial\uc_tskill hence no need to create these. To run and html page double click on its file name it will be displayed in your browser. | ||
<table cellpadding="2"> | |||
<tr> | |||
<td> | |||
'''Links:''' | '''Links:''' | ||
The page contains two links: | The page contains two links: | ||
<nowiki>href="ftp://localhost/boom_x.wav"</nowiki><br> | |||
<nowiki>href="ftp://localhost/explosion_x.wav"</nowiki> | |||
'''''Note:''''' The mount command has mapped the wav folder into the server root. | '''''Note:''''' The mount command has mapped the wav folder into the server root.<br> This is why there are no sub-folders specified in the link construction. | ||
</td> | |||
<td> | |||
& | | ||
</td> | |||
<td> | |||
{| cellpadding= | {| cellpadding="2" cellspacing="1" style="background:#000000;" | ||
|- style= | |- style="background:#e8e8e8;" | ||
! & | ! ''C:\uc_slimftpd_tutorial\uc_tskill\test_pages\test1.html'': check.bat | ||
|- style= | |- style="background:#f5f5f5;" | ||
| | | | ||
<nowiki><html></nowiki><br> | |||
<nowiki><head></nowiki><br> | |||
<nowiki><title>Test1 Page</title></nowiki><br> | |||
<nowiki></head></nowiki><br> | |||
<nowiki><body></nowiki><br> | |||
<nowiki>Download test:<br></nowiki><br> | |||
<nowiki> <a href="ftp://localhost/boom_x.wav">Download My music 1</a><br></nowiki><br> | |||
<nowiki> <a href="ftp://localhost/explosion_x.wav">Download My music 2</a></nowiki><br> | |||
<nowiki></body></nowiki><br> | |||
<nowiki></html></nowiki> | |||
|} | |} | ||
</td> | |||
</tr> | |||
</table> | |||
Run the page (double click on test1.html), click on either of the links and your browser will offer you the choice to either play (open) or save the file to disk. | Run the page (double click on test1.html), click on either of the links and your browser will offer you the choice to either play (open) or save the file to disk. | ||
Line 108: | Line 107: | ||
Matching my music files I have a range of CD cover images. These are large images contained in a separate folder; I would like to make these download-able. | Matching my music files I have a range of CD cover images. These are large images contained in a separate folder; I would like to make these download-able. | ||
{|width= | {|width="80%" style="background:#333333" cellpadding="4" cellspacing="1" | ||
|-style= | |-style="background:#eeeeee" | ||
| | | | ||
Modify SlimFTPd’s configuration as shown in bold. | Modify SlimFTPd’s configuration as shown in bold. | ||
Line 115: | Line 114: | ||
'''''Note:''''' I have added Allow '''List''' so you can see what is listed in the root. | '''''Note:''''' I have added Allow '''List''' so you can see what is listed in the root. | ||
| | | | ||
<User "anonymous"><br> | |||
& | Password ""<br> | ||
& | Mount / C:/uc_slimftpd_tutorial/uc_tskill/wav<br> | ||
'''& | ''' Mount / C:/uc_slimftpd_tutorial/uc_tskill/images '''<br> | ||
& | Deny /All<br> | ||
& | Allow / Read '''List'''<br> | ||
</User> | |||
|} | |} | ||
# Stop (uc_kill_process.bat) and re-start SlimFTPd (SlimFTPd.exe) this forces configuration changes to take effect. | # Stop (uc_kill_process.bat) and re-start SlimFTPd (SlimFTPd.exe) this forces configuration changes to take effect. | ||
# Type ''' | # Type '''<nowiki>ftp://localhost</nowiki>''' into your browser address bar. | ||
# Your browser displays the FTP servers root content. | # Your browser displays the FTP servers root content. | ||
# '''BIG PROBLEM''' what happened to the wav files?. | # '''BIG PROBLEM''' what happened to the wav files?. | ||
Line 137: | Line 136: | ||
Adding sub-folders to the server root will resolve the above problem. You can use the same name as the folders being mapped e.g. wav and images or use alternative names top_ten_music blockbuster_images. | Adding sub-folders to the server root will resolve the above problem. You can use the same name as the folders being mapped e.g. wav and images or use alternative names top_ten_music blockbuster_images. | ||
{|width= | {|width="80%" style="background:#333333" cellpadding="4" cellspacing="1" | ||
|-style= | |-style="background:#eeeeee" | ||
| | | | ||
Modify SlimFTPd’s configuration as shown in bold. | Modify SlimFTPd’s configuration as shown in bold. | ||
'''''Note:''''' The permissions of the root sub-folders '''top_ten_music''' and '''blockbuster_images''' inherit the root folders permissions | '''''Note:''''' The permissions of the root sub-folders '''top_ten_music''' and '''blockbuster_images''' inherit the root folders permissions "Allow / Read List". | ||
| | | | ||
<User "anonymous"><br> | |||
& | Password ""<br> | ||
& | Mount /'''top_ten_music''' C:/uc_slimftpd_tutorial/uc_tskill/wav<br> | ||
& | Mount /'''blockbuster_images''' C:/uc_slimftpd_tutorial/uc_tskill/images<br> | ||
& | Deny /All<br> | ||
& | Allow / Read List<br> | ||
</User> | |||
|} | |} | ||
# Stop (uc_kill_process.bat) and re-start SlimFTPd (SlimFTPd.exe) this forces configuration changes to take effect. | # Stop (uc_kill_process.bat) and re-start SlimFTPd (SlimFTPd.exe) this forces configuration changes to take effect. | ||
# Type ''' | # Type '''<nowiki>ftp://localhost</nowiki>''' into your browser address bar. | ||
# Your browser displays the FTP servers root content, no files however there are two folders: | # Your browser displays the FTP servers root content, no files however there are two folders:<br>'''top_ten_music''' and '''blockbuster_images''' | ||
'''''Illusion:''''' Well the user sees folders that do not exist on your disk. | '''''Illusion:''''' Well the user sees folders that do not exist on your disk. | ||
Line 164: | Line 163: | ||
All test pages are contained in folder C:\uc_slimftpd_tutorial\uc_tskill hence no need to create these. To run just double click on the file name it will be displayed in your browser. | All test pages are contained in folder C:\uc_slimftpd_tutorial\uc_tskill hence no need to create these. To run just double click on the file name it will be displayed in your browser. | ||
<table cellpadding="2"> | |||
<tr> | |||
<td> | |||
'''''Links:''''' | '''''Links:''''' | ||
The page contains four links: | The page contains four links: | ||
<nowiki>href="ftp://localhost/top_ten_music/boom_x.wav</nowiki><br> | |||
<nowiki>href="ftp://localhost/top_ten_music/explosion_x.wav</nowiki><br> | |||
<nowiki>href="ftp://localhost/blockbuster_images/users.gif"</nowiki><br> | |||
<nowiki>href="ftp://localhost/blockbuster_images/setup.gif</nowiki> | |||
'''''Note:''''' The mount command has created new sub-folders '''top_ten_music''' and '''blockbuster_images''' our real folder '''wav''' and '''images''' have been mapped into these respectively. | '''''Note:''''' The mount command has created new sub-folders '''top_ten_music''' and '''blockbuster_images''' our real folder '''wav''' and '''images''' have been mapped into these respectively. | ||
</td> | |||
<td> | |||
& | | ||
</td> | |||
<td> | |||
{| cellpadding= | {| cellpadding="2" cellspacing="1" style="background:#000000;" | ||
|- style= | |- style="background:#e8e8e8;" | ||
! & | ! ''C:\uc_slimftpd_tutorial\uc_tskill\test_pages\test1.html'': check.bat | ||
|- style= | |- style="background:#f5f5f5;" | ||
| | | | ||
<nowiki><html></nowiki><br> | |||
<nowiki><head></nowiki><br> | |||
<nowiki><title>Test2 Page</title></nowiki><br> | |||
<nowiki></head></nowiki><br> | |||
<nowiki><body></nowiki><br> | |||
<nowiki>Download test:<br></nowiki><br> | |||
<nowiki><a href="ftp://localhost/top_ten_music/boom_x.wav">Download My music 1</a><br></nowiki><br> | |||
<a <nowiki>href="ftp://localhost/top_ten_music/explosion_x.wav">Download</nowiki> My music 2<nowiki></a><br></nowiki><br> | |||
<nowiki><a href="ftp://localhost/blockbuster_images/users.gif">Download My image 1</a><br></nowiki><br> | |||
<nowiki><a href="ftp://localhost/blockbuster_images/setup.gif">Download My image 2</a></nowiki><br> | |||
<nowiki></body></nowiki><br> | |||
<nowiki></html></nowiki> | |||
|} | |} | ||
</td> | |||
</tr> | |||
</table> | |||
'''Run the page''' (double click on test2.html). | '''Run the page''' (double click on test2.html). | ||
Line 216: | Line 215: | ||
Individual accounts are accessible using their full FTP address, these look similar to an email address and have the following format: | Individual accounts are accessible using their full FTP address, these look similar to an email address and have the following format: | ||
''' | '''<nowiki>ftp://username@ftp_domain_name</nowiki>''' e.g. <nowiki>http://fred@uniserver.com</nowiki> | ||
FTP addresses for testing as follows: | FTP addresses for testing as follows: | ||
# ''' | # '''<nowiki>ftp://localhost/</nowiki>''' - Access anonymous account | ||
# ''' | # '''<nowiki>ftp://ric@localhost/</nowiki>''' - Individual account | ||
# ''' | # '''<nowiki>ftp://dave@localhost/</nowiki>''' - Individual account | ||
# ''' | # '''<nowiki>ftp://john@localhost/</nowiki>''' - Individual account | ||
Note: When using individual accounts you will notice a reduced login pop-up requires only a password. | Note: When using individual accounts you will notice a reduced login pop-up requires only a password. |
Latest revision as of 07:54, 24 November 2010
SlimFTPd: Home | Tutorial | Clients | Config File | Config Anonymous | Plugins | |
Anonymous user configuration. |
For the majority of Internet users, FTP’s real power is transparent. At the click of a link, they can initiate an FTP server download; these users are anonymous never needing to provide a user name and password.
This part of the tutorial covers using SlimFTPd for anonymous user access. It is extremely easy to set up, provide a user profile with user name set to “anonymous” with a blank password and restrict access to read as shown to the right. |
<User "anonymous"> |
That essentially completes this part of the tutorial! If you are interested in a little more detail or want to run some examples read on.
Anonymous user profile 1
I have a folder containing wave music files and would like to make these downloadable from a web page. The anonymous user profile has the following format:
Add the user profile on the right to the end of SlimFTPd’s configuration file. C:\uc_slimftpd_tutorial\slimftpd.conf |
<User "anonymous"> |
- Stop (uc_kill_process.bat) and re-start SlimFTPd (SlimFTPd.exe) this forces configuration changes to take effect.
- Type ftp://localhost into your browser address bar.
- You will receive a 550-error list permission denied, not surprising because allow was set to read only.
Note: For testing you can allow listing (Allow / Read List). This will allow you to see what’s mapped into the server root. Its not a security issue most download sites allow full listings it’s your site your choice.
Simple test file
All test pages are contained in folder C:\uc_slimftpd_tutorial\uc_tskill hence no need to create these. To run and html page double click on its file name it will be displayed in your browser.
Links: The page contains two links: href="ftp://localhost/boom_x.wav" Note: The mount command has mapped the wav folder into the server root. |
|
|
Run the page (double click on test1.html), click on either of the links and your browser will offer you the choice to either play (open) or save the file to disk.
Anonymous user profile 2
Matching my music files I have a range of CD cover images. These are large images contained in a separate folder; I would like to make these download-able.
Modify SlimFTPd’s configuration as shown in bold. Note: I have added Allow List so you can see what is listed in the root. |
<User "anonymous"> |
- Stop (uc_kill_process.bat) and re-start SlimFTPd (SlimFTPd.exe) this forces configuration changes to take effect.
- Type ftp://localhost into your browser address bar.
- Your browser displays the FTP servers root content.
- BIG PROBLEM what happened to the wav files?.
Problem: At first sight the logic looks sound, map the folders across, they contain different file formats that will not conflict. In reality you may be mapping large folders across that do contain identical file names, hence the last folder listed is mapped to prevent conflicts.
Solution: For this simple case you could copy all the images into the wave file folder. However consider the consequence you have just doubled your image disk space. Earlier I mentioned these images were large now pop out and buy a new disk. The next example offers an alternative solution.
Anonymous user profile 3
Adding sub-folders to the server root will resolve the above problem. You can use the same name as the folders being mapped e.g. wav and images or use alternative names top_ten_music blockbuster_images.
Modify SlimFTPd’s configuration as shown in bold. Note: The permissions of the root sub-folders top_ten_music and blockbuster_images inherit the root folders permissions "Allow / Read List". |
<User "anonymous"> |
- Stop (uc_kill_process.bat) and re-start SlimFTPd (SlimFTPd.exe) this forces configuration changes to take effect.
- Type ftp://localhost into your browser address bar.
- Your browser displays the FTP servers root content, no files however there are two folders:
top_ten_music and blockbuster_images
Illusion: Well the user sees folders that do not exist on your disk.
Fine control: The sub-folders inherit privileges from the root folder “/” hence if for whatever reasons you want to prevent images being listed you can target that sub-folder and deny listing for example Deny /blockbuster_images List
Test file:
All test pages are contained in folder C:\uc_slimftpd_tutorial\uc_tskill hence no need to create these. To run just double click on the file name it will be displayed in your browser.
Links: The page contains four links: href="ftp://localhost/top_ten_music/boom_x.wav Note: The mount command has created new sub-folders top_ten_music and blockbuster_images our real folder wav and images have been mapped into these respectively. |
|
|
Run the page (double click on test2.html).
- Click on either of the music links and your browser will offer you the choice to either play (open) or save the file to disk.
- Click the image links these will most likely display the image however if you right click and save they are downloaded as an FTP transfer.
Email like address
After adding an anonymous user profile it is no longer possible to easily access individual accounts using a browser (user name password login pop-up not accessible).
An FTP server automatically logs into the anonymous account when its domain name is used for access. Individual accounts are accessible using their full FTP address, these look similar to an email address and have the following format:
ftp://username@ftp_domain_name e.g. http://fred@uniserver.com
FTP addresses for testing as follows:
- ftp://localhost/ - Access anonymous account
- ftp://ric@localhost/ - Individual account
- ftp://dave@localhost/ - Individual account
- ftp://john@localhost/ - Individual account
Note: When using individual accounts you will notice a reduced login pop-up requires only a password.
Summary
That concludes this tutorial; I hope you found it of some use! The tutorial's FTP server as you have seen is a fully functioning stand-alone server and can be used independently of Uniform Server.
The server example using virtual hosts is important. A variant of it can be used when using SlimFTPd as a plugin.
The next page covers plugins for Uniform Server 3.5-Apollo and Uniform Server 3.3.
Ric |