Page 1 of 6 123 ... LastLast
Results 1 to 10 of 53

Thread: [HOWTO] Sharing files with vsftpd ftp server

  1. #1
    Join Date
    Jan 2005
    Beans
    30

    [HOWTO] Sharing files with vsftpd ftp server

    Vsftpd is the most easy ftp server to setup.

    Installing vsftpd:
    Code:
    sudo apt-get install vsftpd
    The configuration file for vsftpd is located in /etc/vsftpd.conf. The default configuration is a little bit paranoid, not so usable for file sharing. So use this configuration instead:
    Code:
    # Put in /etc/vsftpd.conf
    # Don't forget to change samurai into your local username
    listen=YES
    anonymous_enable=YES
    local_enable=YES
    write_enable=YES
    anon_upload_enable=YES
    anon_mkdir_write_enable=YES
    dirmessage_enable=YES
    xferlog_enable=YES
    connect_from_port_20=YES
    chown_uploads=YES
    chown_username=samurai
    ftpd_banner=Welcome to blah FTP service.
    secure_chroot_dir=/var/run/vsftpd
    pam_service_name=vsftpd
    rsa_cert_file=/etc/ssl/certs/vsftpd.pem
    anon_root=/home/ftp
    Don't forget to backup before you use this configuration.
    Code:
    sudo cp /etc/vsftpd.conf /root/
    Now we must make writable directory for anonymous user.
    Code:
    cd /home/ftp
    sudo mkdir opendir
    sudo chmod 777 opendir/
    Ok, I explain this. In my local system, I have user named 'samurai'. With this configuration, I can log into ftp server with local user, that is 'samurai'. 'samurai' can go anywhere, create files, delete files, etc as long as he has sufficient permission.

    With this configuration I can log into ftp server with anonymous user ( without username and password ). After logging in, the anonymous user jailed in /home/ftp directory ( pointed by anon_root ). I can't go outside. I can download files from /home/ftp directory but not create, delete anything from this directory. But I can write and delete files in opendir. If I write files in opendir or upload files in opendir, the files automatically belong to 'samurai' user.

    To run this server:
    Code:
    sudo /etc/init.d/vsftpd start
    To stop it:
    Code:
    sudo /etc/init.d/vsftpd stop
    To restart it:
    Code:
    sudo /etc/init.d/vsftpd restart
    Now it is usable for file sharing, right?!!!!

  2. #2
    Join Date
    Nov 2004
    Beans
    473

    Re: [HOWTO] Sharing files with vsftpd ftp server

    Is is necessary to make any changes to /etc/inetd/inetd.conf?

    e.g
    ftp stream tcp nowait root /usr/sbin/tcpd /usr/sbin/vsftpd
    Ubuntu User number is # 33337, Linux Registered User #531864, Boot info script, Wireless info script

  3. #3
    Join Date
    Jan 2005
    Beans
    30

    Re: [HOWTO] Sharing files with vsftpd ftp server

    I use vsftpd here as standalone daemon so I don't touch inetd.conf.

    Before configuring vsftpd itself, you must decide whether to run it as a standalone dæmon or by way of a super-server, inetd or xinetd. In previous versions of vsftpd, its developer recommended using it with xinetd due to xinetd's logging and access-control features. However, vsftpd versions 1.2 and later have native support for most of those features. For this reason, Evans now recommends that vsftpd be run as a standalone dæmon. In addition, a performance cost is associated with using inetd or xinetd. The cost isn't warranted if your system is to be a dedicated FTP server or if you anticipate FTP comprising a significant percentage of your system's activity.

  4. #4
    Join Date
    Nov 2004
    Beans
    473

    Re: [HOWTO] Sharing files with vsftpd ftp server

    Quote Originally Posted by merinda
    I use vsftpd here as standalone daemon so I don't touch inetd.conf.

    Before configuring vsftpd itself, you must decide whether to run it as a standalone dæmon or by way of a super-server, inetd or xinetd. In previous versions of vsftpd, its developer recommended using it with xinetd due to xinetd's logging and access-control features. However, vsftpd versions 1.2 and later have native support for most of those features. For this reason, Evans now recommends that vsftpd be run as a standalone dæmon. In addition, a performance cost is associated with using inetd or xinetd. The cost isn't warranted if your system is to be a dedicated FTP server or if you anticipate FTP comprising a significant percentage of your system's activity.
    Thanks Merinda.

    I was surprised at how simple it was to install and setup! <5mins!!

    In the long run it could be a standalone server, but at the moment I'm just trying things out.

    Would it be possible to add some example upload and down ftp session output to this howto?
    Ubuntu User number is # 33337, Linux Registered User #531864, Boot info script, Wireless info script

  5. #5
    Join Date
    Oct 2004
    Location
    Barcelona, Spain
    Beans
    191
    Distro
    Ubuntu Development Release

    Re: [HOWTO] Sharing files with vsftpd ftp server

    I wouldn't suggest to set write_enable=YES unless you explain people what it does.

    -------------------------------------
    Ubuntu in Spanish is Ubuñtu!
    Running Aspire 9814 AMD64 & Extensa 5620

  6. #6
    Join Date
    Jan 2005
    Beans
    30

    Re: [HOWTO] Sharing files with vsftpd ftp server

    Code:
    I wouldn't suggest to set write_enable=YES unless you explain people what it does.
    He he, I should have to write that this is for sharing files where you can read and write. As I remembered, the default configuration can get you share files with people, only it's very limited. Only anonymous.

    Code:
    Would it be possible to add some example upload and down ftp session output to this howto?
    I don't understand your statement.

  7. #7
    Join Date
    Nov 2005
    Beans
    28
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: [HOWTO] Sharing files with vsftpd ftp server

    i get this error
    Code:
        SmartFTP v1.5.990.26
        Resolving host name "192.168.2.100"
        Connecting to 192.168.2.100 Port: 21
        Connected to 192.168.2.100.
    220 Welcome to blah FTP service.
        USER anonymous
    331 Please specify the password.
        PASS (hidden)
    500 OOPS: vsftpd: refusing to run with writable anonymous root
    500 OOPS: child died
        Cannot login waiting to retry (30s)...
        Server closed connection

    and my conf file is this
    Code:
    listen=YES
    anonymous_enable=YES
    local_enable=YES
    write_enable=YES
    anon_upload_enable=YES
    anon_mkdir_write_enable=YES
    dirmessage_enable=YES
    xferlog_enable=YES
    connect_from_port_20=YES
    chown_uploads=YES
    chown_username=gurumadmat
    ftpd_banner=Welcome to blah FTP service.
    secure_chroot_dir=/var/run/vsftpd
    pam_service_name=vsftpd
    rsa_cert_file=/etc/ssl/certs/vsftpd.pem
    anon_root=/var/www
    can someone make me a good config file?
    i want to log on from anywhere with my local username and password

    and how do i change the port to 25001 ?
    Last edited by GuruMadMat; November 28th, 2005 at 06:21 PM.

  8. #8
    Join Date
    Sep 2005
    Location
    Europe , the Netherlands
    Beans
    33
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: [HOWTO] Sharing files with vsftpd ftp server

    Thanks
    This is great !!!
    Works !!!! =D>

    ------------------------------------------


    Acer laptop 1522, 528mb, AMD 64 3000, 64mb Nvidia.
    http://www.antarctica-rbak.nl/ubuntu
    Last edited by bierpullen; October 23rd, 2007 at 07:36 PM.

  9. #9
    Join Date
    Nov 2005
    Beans
    11

    Re: [HOWTO] Sharing files with vsftpd ftp server

    This was an awesome guide!!! I had so much trouble with proftpd & was pulling my hair out, all I wanted to do was share files & samba wasn't very happy with my macintosh. vsftpd was working in minutes . However I have a iMac G5. Using the finder to connect to my Ubuntu machine (Command K) it mounts in NFS format and I cannot place files into the Ubuntu FTP directory even though I issued a "chmod 777". The only way for me to access the Ubuntu machine is through Transmit an FTP client for Mac OS X. I'm at a loss but thanks for this great guide anyway.

  10. #10
    Join Date
    Nov 2005
    Location
    NYC
    Beans
    109
    Distro
    Ubuntu Development Release

    Re: [HOWTO] Sharing files with vsftpd ftp server

    This is a nice little guide. I've been using vsftpd for sometime now myself and I like it.

    One thing I will mention is that if you want to share with people not on your local network i.e. someone over the internet (a friend etc.), you would have to forward ports 20-21 through your router (if you have one) and then open up those ports on your ubuntu box to recieve the connection. A safer way (not taking into consideration ip spoofing) is to get the ip address of the friend and only allow incoming connections on the above said ports from that paritcular ip.
    Last edited by ruffneck; December 2nd, 2005 at 10:07 AM.

Page 1 of 6 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
  •