Page 1 of 10 123 ... LastLast
Results 1 to 10 of 99

Thread: HOWTO Ridiculously easy home file sharing with FTP and Zeroconf

  1. #1
    Join Date
    May 2006
    Beans
    115

    HOWTO Ridiculously easy home file sharing with FTP and Zeroconf

    The information in this thread has been moved to https://help.ubuntu.com/community/Ea...FTPAndZeroconf


    A thread for discussion of the wiki page only can be found here http://ubuntuforums.org/showthread.php?t=2012424

    Thread closed.

    This tutorial will cover setting up ridiculously easy, reliable, cross platform, standards based home networking. You will be able to share files from any Ubuntu/Debian system and connect to them from any Linux, Windows or OS X box. If you want to share your files on a firewalled home network but dont want to bother with Samba, NFS, or AFP this is for you.

    I chose FTP because it is supported on all systems since the beginning of time, it is secure enough for home use and its easy get working. Samba/SMB is too difficult to set up for the novice user, is Windows centric and has various problems with transfer failures and slowdowns. NFS was designed for Linux, but is, like Samba, too difficult for the novice user.

    I started out to do this with SSH, but decided on FTP after seeing GShare. I chose not use GShare for several reasons: it has a great many dependencies that my approach doesnt require, its FTP server was written from scratch and is therefore almost by definition more insecure and less interoperable than the FTP daemon we will use and I wanted to lock users into their home directories by default.

    Enough with the formalities, lets get to it.

    Setting up the FTP daemon

    We will use vsftpd (Very Secure FTP Daemon) as our FTP server.

    Install vsftpd

    Code:
    sudo apt-get install vsftpd
    Configuring vsftpd

    We need to modify some vsftpd settings. To edit your configuration file by hand, open the configuration file with

    Code:
    sudo gedit /etc/vsftpd.conf
    Change or uncomment (remove the #) the following parameters

    Code:
        local_enable=YES
        write_enable=YES
        anonymous_enable=NO
        chroot_local_user=YES
    Start vsftpd

    Code:
    sudo /etc/init.d/vsftpd restart
    Vsftpd will now always start automatically when your computer starts.

    Setting up Zeroconf

    Vsftpd will do the file transfer for us, but need some way to find services and name the boxes on our network. Avahi allows us to give our systems names without setting up a DNS server and easily discover services. It is a completely free Zeroconf daemon and the choice of Gnome.

    Install Avahi

    Code:
    sudo apt-get install avahi-daemon avahi-discover avahi-utils libnss-mdns service-discovery-applet mdns-scan
    If all you want is convenient host naming that allows you to use DNS names (ie. hostname.local) without setting up your own DNS server, you can skip the next section. Instructions are provided for connecting to shared files with and without zeroconf service announcements.

    Create Zeroconf Service Announcements (Optional)

    Most OSes zeroconf service discovery support, even zeroconf creator's OS X, is very limited. The potential of this technology is great, but for now this section is helpful but not critical.

    To edit by hand, run

    Code:
    sudo gedit /etc/avahi/services/ftp.service
    and paste

    Code:
        
        <?xml version="1.0" standalone='no'?>
        <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
        <service-group>
        <name>FTP file sharing</name>
        <service>
        <type>_ftp._tcp</type>
        <port>21</port>
        </service>
        </service-group>
    Save an close Gedit.

    Restart Avahi

    Code:
    sudo /etc/init.d/avahi-daemon restart
    Repeat!

    Now do what you just did on every Ubuntu/Debian computer you wish to share files from. You only need to do the Install Avahi section on the Ubuntu/Debian systems that you want only to connect to shares from.

    Connecting to your shared files

    Connect from Ubuntu/Debian (or any Gnome desktop)

    With zeroconf service announcements

    Click Places->Network Servers. You should see an icon labeled FTP File Sharing. Right click on it and click Connect To This Server. You can give this link a new name or just click Connect.

    You should now see an icon labeled FTP File Sharing on your desktop. Double click the icon. You will be asked for your username and password: Select Connect as User. Enter your username and password *that you use to log into the box you are connecting to*. Check 'Remember password for this session.' After you click OK, your home directory on your remote machine should appear. You should not have to enter your username or password again until you log out of your computer.

    Without zeroconf service announcements

    Click Places->Connect to Server. Click the Service Type dropdown and select 'FTP (with login)'. Enter hostname.local in Server, in 'User Name' enter the username *that you use to log into the box you are connecting to*, and set 'Name to use for this connection' to FTP File Sharing.

    You should now see an icon labeled FTP File Sharing on your desktop. Double click the icon. Enter your password *that you use to log into the box you are connecting to* and check 'Remember password for this session'. After you click Connect, your home directory on your remote machine should appear. You should not have to enter your username or password again until you log out of your computer.

    Connect from OS X

    OS X natively supports connecting to FTP through the Finder. The only drawback is that mounted shares are read only.

    Without zeroconf service announcements

    Open Finder. Click Go > Connect to Server. Enter 'ftp://hostname.local' then click Connect. Enter your username, password and check 'Remember this password', then click OK. There will now be a new Finder entry for your ftp site.

    With zeroconf service announcements

    Open Safari. Press Option+Apple+B to open bookmarks. Click on the Bonjour icon. Find the name of the service you want to connect to and double click it.

    Connect from Windows

    Because Microsoft is backing its own zeroconf-ish protocol, Windows support for zeroconf service announcements is practically non-existant. Apple's Bonjour client is the only real free support for zeroconf on Windows. Its service browsing functions are extremely limited, but it works quite well for host naming. Because service discovery support is so limited, we will not use service discovery when connecting from Windows. Therefore, after installing Bonjour, you can use can use either of the following connection methods whether or not you created zeroconf service announcements.

    Install Bonjour

    Download Apple's Bonjour for Windows here. Run the setup like any other; answer Next, Yes and OK to every question. After your computer restarts, you will have full zeroconf naming support.

    With Explorer

    This method does not create a new drive letter; you will only be able to access files through Explorer.

    Open an Explorer window. Click Tools > Map Network Drive... Click the "Sign up for online storage or connect to a network server" hyperlink. Click Next on the Add Network Place wizard. Click the "Choose another network location" icon and click Next. Enter the host to connect to in the form ftp://hostname.local and click Next. Uncheck "Login anonymously" and fill in the username that you want to connect with then click Next. Change the name of the network place if you wish and click Next then click Finish.

    A window should open and you should be prompted for your password. Enter your password and check Save Password then click Log On. You should now see your files on the remote machine.

    With NetDrive

    Windows cannot mount FTP as a drive natively, but there is a program called NetDrive that does an excellent job. There is already a tutorial that is more complete than anything I could do so follow these instructions to install NetDrive and make one critical change: When you get to "add new site", enter the "Site Address/URL" in the form HOSTNAME.local, where HOSTNAME is the name of the box you are connecting to.

    Success!

    Thats about all there is to it.

    The major drawback to this setup is that most gui-less Linux applications will not be able to save and open files directly. Applications designed especially for Gnome will most likely work, but support is currently hit-and-miss. If you find that your application cannot directly access the share, you will need to manually copy the files, work on them, then copy them back.

    Conclusion

    IMHO, this completely blows away Samba/SMB and NFS for ease of setup, ease of use and cross platform interoperability (although we have not yet made use of this).

    Making our shared files act like part of our file system, and therefore work with any application, is possible and will be covered in a future tutorial. In the future I will add information about mounting FTP shares so that you may access files from any application as if there were on your system. I will also describe how to mount our FTP share on Windows and OSX for truly sublime cross platform file sharing.

    Origionally posted here

    Edit 2006/08/26: Made zeroconf service announcements optional. Added mounting instructions for OS X and Windows.
    Last edited by Elfy; June 29th, 2012 at 09:40 AM. Reason: Removed dead links

  2. #2
    Join Date
    Jun 2005
    Location
    Framingham, MA
    Beans
    190
    Distro
    Kubuntu Development Release

    Re: HOWTO Ridiculously easy home file sharing with FTP and Zeroconf

    Thanks!

    Had a little trouble with konqueror and setting it up in remote:/ but now it works perfectly, dunno what was happening at first.

    For anybody trying with konqueror by typing in the address yourself: for some reason using ftp://hostname:21/ gives some error about the password, but ftp://username@hostname:21/ works fine.

    Also, you should edit the name and host name in the provided ftp.service file.
    (Intel Core i7 860, 2x2GB, Gigabyte GA-P55-UD3L, Radeon HD 4550, Audigy2 ZS Platinum, Sonata) + Asus V6J + Lenovo IdeaPad U330
    YOU can make Kubuntu Lucid a solid distro | My Blog

  3. #3
    Join Date
    May 2006
    Beans
    115

    Re: HOWTO Ridiculously easy home file sharing with FTP and Zeroconf

    Quote Originally Posted by GameManK View Post
    for some reason using ftp://hostname:21/ gives some error about the password, but ftp://username@hostname:21/ works fine.

    Also, you should edit the name and host name in the provided ftp.service file.
    good catches. ive updated the ftp.service file to remove hostname; it is not actually necessary. and i also unscrambled the ftp.service file that i posted inline.

    i used this today in an open lab to transfer files between Windows, OSX and Linux boxes; it worked like a dream. hopefully ill have time to add exact instructions soon.

    IMHO, IPP + FTP + Zeroconf could completely replace Apple and Microsofts respective workgroup networking schemes. If only FTP did file locking.
    Last edited by dyssident; July 20th, 2006 at 03:47 AM.

  4. #4
    Join Date
    Jun 2005
    Beans
    76

    Re: HOWTO Ridiculously easy home file sharing with FTP and Zeroconf

    Maybe I missed something here, but why is this method any better than SMB or NFS? I'm looking to configure file sharing on my home network right now, and it would be great if you could figure out how to mount drives across the network like other protocols. I'm interested in implementing this, because SMB has performance issues and NFS is *nix only.

  5. #5
    Join Date
    May 2006
    Beans
    115

    Re: HOWTO Ridiculously easy home file sharing with FTP and Zeroconf

    Quote Originally Posted by vkkim View Post
    Maybe I missed something here, but why is this method any better than SMB or NFS?
    my reason for going with this setup was a frustration with nfs and samba. experienced users can handle the setup, but my mom cant; the complexity simply isnt justified for home or small workgroup users. plus, this setup adds interoperability between OSes, without loosing any functionality (except file locking).

    Quote Originally Posted by vkkim View Post
    it would be great if you could figure out how to mount drives across the network like other protocols.
    it can definiately be done. im working on instructions for mounting on Windows and OSX at this very moment. btw, what OS are you running?
    Last edited by dyssident; July 20th, 2006 at 10:06 AM.

  6. #6
    Join Date
    Jun 2005
    Beans
    76

    Re: HOWTO Ridiculously easy home file sharing with FTP and Zeroconf

    Well, I'm obviously running Ubuntu on my server, but the rest of my environment is a mix of Windows XP/Vista and Ubuntu.

  7. #7
    Join Date
    May 2006
    Beans
    115

    Re: HOWTO Ridiculously easy home file sharing with FTP and Zeroconf

    Quote Originally Posted by vkkim View Post
    it would be great if you could figure out how to mount drives across the network like other protocols.
    Ive done some research, and you probably wont be surprised to learn that it will work on windows but it is much less elegant.

    The two Zeroconf clients that exist for windows only look for HTTP services. Zeroconf will still do easy host naming for us, but we wont be able to conveniently browse for the FTP service like with linux.

    Try these steps and let me know what you think:

    Follow these instructions to install NetDrive and make one critical change: When you get to "add new site", enter the "Site Address/URL" in the form HOSTNAME.local, where HOSTNAME is the name of the linux box you are connecting to.

    That is about the most elegant solution ive found. If this works for you, let me know and ill add it to this tutorial.

  8. #8
    Join Date
    Jun 2005
    Beans
    76

    Re: HOWTO Ridiculously easy home file sharing with FTP and Zeroconf

    Quote Originally Posted by dyssident View Post
    Follow these instructions to install NetDrive and make one critical change: When you get to "add new site", enter the "Site Address/URL" in the form HOSTNAME.local, where HOSTNAME is the name of the linux box you are connecting to.

    That is about the most elegant solution ive found. If this works for you, let me know and ill add it to this tutorial.
    I'm not too sure about running NetDrive, read the comments here. Anyway, installing a Samba server isn't much more than aptitude install samba, which I think is much easier than setting up an ftp PLUS zeroconf, and I'm running an SFTP server now as well which is more secure than FTP. I'm also looking for (S)FTP mounting solutions to get rid of Samba, but for now I think Samba is a better choice (at least for Windows).

  9. #9
    Join Date
    Nov 2005
    Location
    Oz
    Beans
    4,405

    Re: HOWTO Ridiculously easy home file sharing with FTP and Zeroconf

    Thanks Dyssident, this is just what I need to set up my wifes OSX Panther Powerbook to be able to save files onto her Dapper desktop box. We allready have our 2 Dapper boxes the Mac & an HP LJ-5 on the LAN, they only print & use the internet together at the moment though.

    So, I will be watching this thread like a hawk to see when you add the OSX how-to...

    Do you think I will have to run Firestarter, even though the router has a firewall function built in?

    Thanks again, I believe that you will have made life a lot less stressful for a lot of people with these how-to's!
    Last edited by handy; July 24th, 2006 at 05:32 AM.

  10. #10
    Join Date
    May 2006
    Beans
    115

    Re: HOWTO Ridiculously easy home file sharing with FTP and Zeroconf

    Quote Originally Posted by handy View Post
    We allready have our 2 Dapper boxes the Mac & an HP LJ-5 on the LAN, they only print & use the internet together at the moment though.
    How are you doing network printing? Is one box a print server or do you print directly with a jetdirect card?

    Quote Originally Posted by handy View Post
    So, I will be watching this thread like a hawk to see when you add the OSX how-to...
    Unfortunately, the only access i have to Macs is on campus and their network is segregated from the open network, so a really elegant solution might take me a while. However, I know that since Tiger 10.4 comes with Bonjour by default, as long as you are on the same subnet, which no doubt at home you are, you can just use Finder's Connect to Server (or something like that) option and give it the servers mdns name eg HOSTNAME.local

    You should then have a new drive in Finder that is the default directory of your remote FTP server.

    Quote Originally Posted by handy View Post
    Do you think I will have to run Firestarter, even thought the router has a firewall function built in?
    Some security hardcases will tell you to run a firewall on everything, but i dont see how two firewalls are more secure than one, assuming that one is set up correctly (ie. you dont have a virtual server for your boxes FTP server set up).

Page 1 of 10 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •