Apach/ftp secure webserver

Discussion in 'Site & Server Administration' started by sovtek1971, Feb 9, 2012.

  1. #1
    Hello

    I'm trying to setup a VPS web server account with Debian and LAMP as well as Drupal. I've gotten everything setup and the website working but I'm a little confused on how to setup FTP. I've installed Pureftp. Now my question is how do I setup a user that can access the files in /var/www/ via ftp and be secure? If I chroot the user I have on the server (ie not root) then I will not be able to write access to the files in /var/www. I've looked on the web how to setup a secure webserver and ftp and I can find docs on either or but not both.

    TIA
     
    sovtek1971, Feb 9, 2012 IP
  2. ideamine

    ideamine Member

    Messages:
    83
    Likes Received:
    2
    Best Answers:
    2
    Trophy Points:
    28
    #2
    Hi,

    As far as i know chroot means when the user logs in via ftp he can only view/edit the files inside his home directory. Hence create a user change his home directory to /var/www and chroot him. The ftp should work fine ..
     
    ideamine, Feb 9, 2012 IP
  3. sovtek1971

    sovtek1971 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I created the user with the HOME dir as /var/www but I can't a ctually login with that user from the shell command line or from ftp.
    I get:
    No directory, logging in with HOME=/Cannot execute /opt/bin/ftponly: No such file or directory

    I assume I need to make /var/www and subdirectories owned by my ftpuser and group www-data. However I'm worried that it will affect the running of apache and drupal.
     
    sovtek1971, Feb 11, 2012 IP
  4. BigTim3

    BigTim3 Guest

    Messages:
    266
    Likes Received:
    1
    Best Answers:
    2
    Trophy Points:
    0
    #4
    You can add users to groups and chown root:groupname
     
    BigTim3, Feb 12, 2012 IP