Can I make a user's home directory be /var/www/html for vsftp?Setting up SFTP to log in to server with...

Why does nature favour the Laplacian?

What happened to Captain America in Endgame?

What route did the Hindenburg take when traveling from Germany to the U.S.?

In order to check if a field is required or not, is the result of isNillable method sufficient?

Examples of subgroups where it's nontrivial to show closure under multiplication?

Fizzy, soft, pop and still drinks

Is there a way to get a compiler for the original B programming language?

How to reduce LED flash rate (frequency)

What are the potential pitfalls when using metals as a currency?

Normal Map bad shading in Rendered display

Size of electromagnet needed to replicate Earth's magnetic field

Reducing vertical space in stackrel

Critique of timeline aesthetic

Error message with tabularx

what is the sudo password for a --disabled-password user

How to make a pipeline wait for end-of-file or stop after an error?

Is there really no use for MD5 anymore?

How to verbalise code in Mathematica?

How to solve constants out of the internal energy equation?

Why was Germany not as successful as other Europeans in establishing overseas colonies?

Symbolic Multivariate Distribution

How can Republicans who favour free markets, consistently express anger when they don't like the outcome of that choice?

Unexpected email from Yorkshire Bank

US visa is under administrative processing, I need the passport back ASAP



Can I make a user's home directory be /var/www/html for vsftp?


Setting up SFTP to log in to server with FilezillaConfigure vsftpd to chown uploaded filesHow to add permission to write to /var/www for my FTP clientCreate FTP users with limited access only to home directory Ubuntu 12.04SoftException in Application.cpp:566: Directory “/var/www/html/” is writeable by groupSetup /var/www for two groupsIs there an easy to use, simple FTP server for Ubuntu serverChange home directory to /var/www/html/~vsftpd folder file permission in ubuntuChanging permissions for /var/www/htmlHow do I set priviledges for /var/www and sftpd the right way?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















I have an Ubuntu 16.04 web server. It only hosts one site using Nginx. I want to keep things very simple, and store the index.html file and the whole website in /var/www/html.



I need to be able to FTP files into /var/www/html. I have installed vsftp. I've created a user with the useradd command, which I'll call exampleuser. I then used this command:



sudo usermod -d /var/www/html exampleuser


... thinking that this would make the home directory of exampleuser to be the default directory when I log in by FTP.



However, when I attempt to log in by FTP, I get a "login error". I've checked and double checked my username and password and I'm certain they're correct, so I'm guessing it's a permissions issue (also because my experience is that most of the time in Linux when things don't work as hoped it's because of permissions). Though it's possible it could be a vsftpd configurations issue.



I think I've set the html directory in /var/www to have the right access:



/var/www$ ls -la
total 12
drwxr-xr-x 3 root root 4096 Nov 10 06:54 .
drwxr-xr-x 14 root root 4096 Nov 10 06:54 ..
drwxr-xr-x 2 exampleuser exampleuser 4096 Nov 10 08:04 html


What do I need to do so that I can ftp to /var/www/html?










share|improve this question














bumped to the homepage by Community 16 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Not a security expert but why not have sudo rm /var/www and then have sampleuser create /var/www and /var/www/html? Also does the directory have to be in /var which is a system folder?

    – WinEunuuchs2Unix
    Nov 11 '16 at 17:07











  • What is the log in error ?

    – Panther
    Nov 11 '16 at 17:10











  • @bodhi.zazen, my client says "Login failed." The vsftp log says "FAIL LOGIN: Client".

    – Questioner
    Nov 11 '16 at 17:18






  • 1





    I am not sure it is a permissions problem. You can try making /var and /var/www rwx by your other user, although that has it's own security problems.

    – Panther
    Nov 11 '16 at 17:36






  • 1





    Possible duplicate of Setting up SFTP to log in to server with Filezilla

    – pa4080
    16 hours ago


















1















I have an Ubuntu 16.04 web server. It only hosts one site using Nginx. I want to keep things very simple, and store the index.html file and the whole website in /var/www/html.



I need to be able to FTP files into /var/www/html. I have installed vsftp. I've created a user with the useradd command, which I'll call exampleuser. I then used this command:



sudo usermod -d /var/www/html exampleuser


... thinking that this would make the home directory of exampleuser to be the default directory when I log in by FTP.



However, when I attempt to log in by FTP, I get a "login error". I've checked and double checked my username and password and I'm certain they're correct, so I'm guessing it's a permissions issue (also because my experience is that most of the time in Linux when things don't work as hoped it's because of permissions). Though it's possible it could be a vsftpd configurations issue.



I think I've set the html directory in /var/www to have the right access:



/var/www$ ls -la
total 12
drwxr-xr-x 3 root root 4096 Nov 10 06:54 .
drwxr-xr-x 14 root root 4096 Nov 10 06:54 ..
drwxr-xr-x 2 exampleuser exampleuser 4096 Nov 10 08:04 html


What do I need to do so that I can ftp to /var/www/html?










share|improve this question














bumped to the homepage by Community 16 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Not a security expert but why not have sudo rm /var/www and then have sampleuser create /var/www and /var/www/html? Also does the directory have to be in /var which is a system folder?

    – WinEunuuchs2Unix
    Nov 11 '16 at 17:07











  • What is the log in error ?

    – Panther
    Nov 11 '16 at 17:10











  • @bodhi.zazen, my client says "Login failed." The vsftp log says "FAIL LOGIN: Client".

    – Questioner
    Nov 11 '16 at 17:18






  • 1





    I am not sure it is a permissions problem. You can try making /var and /var/www rwx by your other user, although that has it's own security problems.

    – Panther
    Nov 11 '16 at 17:36






  • 1





    Possible duplicate of Setting up SFTP to log in to server with Filezilla

    – pa4080
    16 hours ago














1












1








1








I have an Ubuntu 16.04 web server. It only hosts one site using Nginx. I want to keep things very simple, and store the index.html file and the whole website in /var/www/html.



I need to be able to FTP files into /var/www/html. I have installed vsftp. I've created a user with the useradd command, which I'll call exampleuser. I then used this command:



sudo usermod -d /var/www/html exampleuser


... thinking that this would make the home directory of exampleuser to be the default directory when I log in by FTP.



However, when I attempt to log in by FTP, I get a "login error". I've checked and double checked my username and password and I'm certain they're correct, so I'm guessing it's a permissions issue (also because my experience is that most of the time in Linux when things don't work as hoped it's because of permissions). Though it's possible it could be a vsftpd configurations issue.



I think I've set the html directory in /var/www to have the right access:



/var/www$ ls -la
total 12
drwxr-xr-x 3 root root 4096 Nov 10 06:54 .
drwxr-xr-x 14 root root 4096 Nov 10 06:54 ..
drwxr-xr-x 2 exampleuser exampleuser 4096 Nov 10 08:04 html


What do I need to do so that I can ftp to /var/www/html?










share|improve this question














I have an Ubuntu 16.04 web server. It only hosts one site using Nginx. I want to keep things very simple, and store the index.html file and the whole website in /var/www/html.



I need to be able to FTP files into /var/www/html. I have installed vsftp. I've created a user with the useradd command, which I'll call exampleuser. I then used this command:



sudo usermod -d /var/www/html exampleuser


... thinking that this would make the home directory of exampleuser to be the default directory when I log in by FTP.



However, when I attempt to log in by FTP, I get a "login error". I've checked and double checked my username and password and I'm certain they're correct, so I'm guessing it's a permissions issue (also because my experience is that most of the time in Linux when things don't work as hoped it's because of permissions). Though it's possible it could be a vsftpd configurations issue.



I think I've set the html directory in /var/www to have the right access:



/var/www$ ls -la
total 12
drwxr-xr-x 3 root root 4096 Nov 10 06:54 .
drwxr-xr-x 14 root root 4096 Nov 10 06:54 ..
drwxr-xr-x 2 exampleuser exampleuser 4096 Nov 10 08:04 html


What do I need to do so that I can ftp to /var/www/html?







server permissions ftp vsftpd






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 11 '16 at 16:54









QuestionerQuestioner

1,5762485149




1,5762485149





bumped to the homepage by Community 16 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 16 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Not a security expert but why not have sudo rm /var/www and then have sampleuser create /var/www and /var/www/html? Also does the directory have to be in /var which is a system folder?

    – WinEunuuchs2Unix
    Nov 11 '16 at 17:07











  • What is the log in error ?

    – Panther
    Nov 11 '16 at 17:10











  • @bodhi.zazen, my client says "Login failed." The vsftp log says "FAIL LOGIN: Client".

    – Questioner
    Nov 11 '16 at 17:18






  • 1





    I am not sure it is a permissions problem. You can try making /var and /var/www rwx by your other user, although that has it's own security problems.

    – Panther
    Nov 11 '16 at 17:36






  • 1





    Possible duplicate of Setting up SFTP to log in to server with Filezilla

    – pa4080
    16 hours ago



















  • Not a security expert but why not have sudo rm /var/www and then have sampleuser create /var/www and /var/www/html? Also does the directory have to be in /var which is a system folder?

    – WinEunuuchs2Unix
    Nov 11 '16 at 17:07











  • What is the log in error ?

    – Panther
    Nov 11 '16 at 17:10











  • @bodhi.zazen, my client says "Login failed." The vsftp log says "FAIL LOGIN: Client".

    – Questioner
    Nov 11 '16 at 17:18






  • 1





    I am not sure it is a permissions problem. You can try making /var and /var/www rwx by your other user, although that has it's own security problems.

    – Panther
    Nov 11 '16 at 17:36






  • 1





    Possible duplicate of Setting up SFTP to log in to server with Filezilla

    – pa4080
    16 hours ago

















Not a security expert but why not have sudo rm /var/www and then have sampleuser create /var/www and /var/www/html? Also does the directory have to be in /var which is a system folder?

– WinEunuuchs2Unix
Nov 11 '16 at 17:07





Not a security expert but why not have sudo rm /var/www and then have sampleuser create /var/www and /var/www/html? Also does the directory have to be in /var which is a system folder?

– WinEunuuchs2Unix
Nov 11 '16 at 17:07













What is the log in error ?

– Panther
Nov 11 '16 at 17:10





What is the log in error ?

– Panther
Nov 11 '16 at 17:10













@bodhi.zazen, my client says "Login failed." The vsftp log says "FAIL LOGIN: Client".

– Questioner
Nov 11 '16 at 17:18





@bodhi.zazen, my client says "Login failed." The vsftp log says "FAIL LOGIN: Client".

– Questioner
Nov 11 '16 at 17:18




1




1





I am not sure it is a permissions problem. You can try making /var and /var/www rwx by your other user, although that has it's own security problems.

– Panther
Nov 11 '16 at 17:36





I am not sure it is a permissions problem. You can try making /var and /var/www rwx by your other user, although that has it's own security problems.

– Panther
Nov 11 '16 at 17:36




1




1





Possible duplicate of Setting up SFTP to log in to server with Filezilla

– pa4080
16 hours ago





Possible duplicate of Setting up SFTP to log in to server with Filezilla

– pa4080
16 hours ago










1 Answer
1






active

oldest

votes


















0














Yes it is a permission error take a look on this tutorial:




FTP is generally more secure when users are restricted to a specific
directory.vsftpd accomplishes this with chroot jails. When chroot is
enabled for local users, they are restricted to their home directory
by default. However, because of the way vsftpd secures the directory,
it must not be writable by the user. This is fine for a new user who
should only connect via FTP, but an existing user may need to write to
their home folder if they also shell access.



In this example, rather than removing write privileges from the home
directory, we're will create an ftp directory to serve as the chroot
and a writable files directory to hold the actual files.



Create the ftp folder, set its ownership, and be sure to remove write
permissions with the following commands:




sudo mkdir /home/sammy/ftp
sudo chown nobody:nogroup /home/sammy/ftp
sudo chmod a-w /home/sammy/ftp


If you try to connect to the ftp and the user can write the folder then it wont connect, you need to add to the root folder the owner nobody:nogroup, so if you want to keep things simple just point your server to the folder where the user can write in your case:



sudo usermod -d /var/www exampleuser


This is because you want to write on HTML folder



sudo chown nobody:nogroup /var/www
sudo chmod a-w /var/www


Modify your server conf file and point to the new location which will be HTML this solution helps a lot if you really want to use Very Safe FTP






share|improve this answer
























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f848274%2fcan-i-make-a-users-home-directory-be-var-www-html-for-vsftp%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Yes it is a permission error take a look on this tutorial:




    FTP is generally more secure when users are restricted to a specific
    directory.vsftpd accomplishes this with chroot jails. When chroot is
    enabled for local users, they are restricted to their home directory
    by default. However, because of the way vsftpd secures the directory,
    it must not be writable by the user. This is fine for a new user who
    should only connect via FTP, but an existing user may need to write to
    their home folder if they also shell access.



    In this example, rather than removing write privileges from the home
    directory, we're will create an ftp directory to serve as the chroot
    and a writable files directory to hold the actual files.



    Create the ftp folder, set its ownership, and be sure to remove write
    permissions with the following commands:




    sudo mkdir /home/sammy/ftp
    sudo chown nobody:nogroup /home/sammy/ftp
    sudo chmod a-w /home/sammy/ftp


    If you try to connect to the ftp and the user can write the folder then it wont connect, you need to add to the root folder the owner nobody:nogroup, so if you want to keep things simple just point your server to the folder where the user can write in your case:



    sudo usermod -d /var/www exampleuser


    This is because you want to write on HTML folder



    sudo chown nobody:nogroup /var/www
    sudo chmod a-w /var/www


    Modify your server conf file and point to the new location which will be HTML this solution helps a lot if you really want to use Very Safe FTP






    share|improve this answer




























      0














      Yes it is a permission error take a look on this tutorial:




      FTP is generally more secure when users are restricted to a specific
      directory.vsftpd accomplishes this with chroot jails. When chroot is
      enabled for local users, they are restricted to their home directory
      by default. However, because of the way vsftpd secures the directory,
      it must not be writable by the user. This is fine for a new user who
      should only connect via FTP, but an existing user may need to write to
      their home folder if they also shell access.



      In this example, rather than removing write privileges from the home
      directory, we're will create an ftp directory to serve as the chroot
      and a writable files directory to hold the actual files.



      Create the ftp folder, set its ownership, and be sure to remove write
      permissions with the following commands:




      sudo mkdir /home/sammy/ftp
      sudo chown nobody:nogroup /home/sammy/ftp
      sudo chmod a-w /home/sammy/ftp


      If you try to connect to the ftp and the user can write the folder then it wont connect, you need to add to the root folder the owner nobody:nogroup, so if you want to keep things simple just point your server to the folder where the user can write in your case:



      sudo usermod -d /var/www exampleuser


      This is because you want to write on HTML folder



      sudo chown nobody:nogroup /var/www
      sudo chmod a-w /var/www


      Modify your server conf file and point to the new location which will be HTML this solution helps a lot if you really want to use Very Safe FTP






      share|improve this answer


























        0












        0








        0







        Yes it is a permission error take a look on this tutorial:




        FTP is generally more secure when users are restricted to a specific
        directory.vsftpd accomplishes this with chroot jails. When chroot is
        enabled for local users, they are restricted to their home directory
        by default. However, because of the way vsftpd secures the directory,
        it must not be writable by the user. This is fine for a new user who
        should only connect via FTP, but an existing user may need to write to
        their home folder if they also shell access.



        In this example, rather than removing write privileges from the home
        directory, we're will create an ftp directory to serve as the chroot
        and a writable files directory to hold the actual files.



        Create the ftp folder, set its ownership, and be sure to remove write
        permissions with the following commands:




        sudo mkdir /home/sammy/ftp
        sudo chown nobody:nogroup /home/sammy/ftp
        sudo chmod a-w /home/sammy/ftp


        If you try to connect to the ftp and the user can write the folder then it wont connect, you need to add to the root folder the owner nobody:nogroup, so if you want to keep things simple just point your server to the folder where the user can write in your case:



        sudo usermod -d /var/www exampleuser


        This is because you want to write on HTML folder



        sudo chown nobody:nogroup /var/www
        sudo chmod a-w /var/www


        Modify your server conf file and point to the new location which will be HTML this solution helps a lot if you really want to use Very Safe FTP






        share|improve this answer













        Yes it is a permission error take a look on this tutorial:




        FTP is generally more secure when users are restricted to a specific
        directory.vsftpd accomplishes this with chroot jails. When chroot is
        enabled for local users, they are restricted to their home directory
        by default. However, because of the way vsftpd secures the directory,
        it must not be writable by the user. This is fine for a new user who
        should only connect via FTP, but an existing user may need to write to
        their home folder if they also shell access.



        In this example, rather than removing write privileges from the home
        directory, we're will create an ftp directory to serve as the chroot
        and a writable files directory to hold the actual files.



        Create the ftp folder, set its ownership, and be sure to remove write
        permissions with the following commands:




        sudo mkdir /home/sammy/ftp
        sudo chown nobody:nogroup /home/sammy/ftp
        sudo chmod a-w /home/sammy/ftp


        If you try to connect to the ftp and the user can write the folder then it wont connect, you need to add to the root folder the owner nobody:nogroup, so if you want to keep things simple just point your server to the folder where the user can write in your case:



        sudo usermod -d /var/www exampleuser


        This is because you want to write on HTML folder



        sudo chown nobody:nogroup /var/www
        sudo chmod a-w /var/www


        Modify your server conf file and point to the new location which will be HTML this solution helps a lot if you really want to use Very Safe FTP







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 1 '17 at 20:38









        Rodolfo AbarcaRodolfo Abarca

        1012




        1012






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f848274%2fcan-i-make-a-users-home-directory-be-var-www-html-for-vsftp%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

            Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

            Simple Scan not detecting my scanner (Brother DCP-7055W)Brother MFC-L2700DW printer can print, can't...