How to change vsftpd's default directory to / instead of the user's home directory?












0














I currently have vsftpd installed in such a way, that when a user, say for instance my account frederik authenticates, I will be directed to my home directory /home/frederik/.



This is a problem for certain FTP clients, as they can not change to anything outside that default folder, for instance /home/ (even given permission).



How can I change it so that authenticated users gets directed to / instead?










share|improve this question






















  • Maybe you won't have to do this. Check this link: vsftpd.beasts.org/vsftpd_conf.html especially your settings of chroot for users.
    – HATEthePLOT
    Mar 2 '16 at 11:11










  • Related: change home directory only when connecting with FTP
    – Eliah Kagan
    Jul 30 '17 at 21:29
















0














I currently have vsftpd installed in such a way, that when a user, say for instance my account frederik authenticates, I will be directed to my home directory /home/frederik/.



This is a problem for certain FTP clients, as they can not change to anything outside that default folder, for instance /home/ (even given permission).



How can I change it so that authenticated users gets directed to / instead?










share|improve this question






















  • Maybe you won't have to do this. Check this link: vsftpd.beasts.org/vsftpd_conf.html especially your settings of chroot for users.
    – HATEthePLOT
    Mar 2 '16 at 11:11










  • Related: change home directory only when connecting with FTP
    – Eliah Kagan
    Jul 30 '17 at 21:29














0












0








0


1





I currently have vsftpd installed in such a way, that when a user, say for instance my account frederik authenticates, I will be directed to my home directory /home/frederik/.



This is a problem for certain FTP clients, as they can not change to anything outside that default folder, for instance /home/ (even given permission).



How can I change it so that authenticated users gets directed to / instead?










share|improve this question













I currently have vsftpd installed in such a way, that when a user, say for instance my account frederik authenticates, I will be directed to my home directory /home/frederik/.



This is a problem for certain FTP clients, as they can not change to anything outside that default folder, for instance /home/ (even given permission).



How can I change it so that authenticated users gets directed to / instead?







14.04 server ftp vsftpd






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 2 '16 at 10:59









Fre_d

9114




9114












  • Maybe you won't have to do this. Check this link: vsftpd.beasts.org/vsftpd_conf.html especially your settings of chroot for users.
    – HATEthePLOT
    Mar 2 '16 at 11:11










  • Related: change home directory only when connecting with FTP
    – Eliah Kagan
    Jul 30 '17 at 21:29


















  • Maybe you won't have to do this. Check this link: vsftpd.beasts.org/vsftpd_conf.html especially your settings of chroot for users.
    – HATEthePLOT
    Mar 2 '16 at 11:11










  • Related: change home directory only when connecting with FTP
    – Eliah Kagan
    Jul 30 '17 at 21:29
















Maybe you won't have to do this. Check this link: vsftpd.beasts.org/vsftpd_conf.html especially your settings of chroot for users.
– HATEthePLOT
Mar 2 '16 at 11:11




Maybe you won't have to do this. Check this link: vsftpd.beasts.org/vsftpd_conf.html especially your settings of chroot for users.
– HATEthePLOT
Mar 2 '16 at 11:11












Related: change home directory only when connecting with FTP
– Eliah Kagan
Jul 30 '17 at 21:29




Related: change home directory only when connecting with FTP
– Eliah Kagan
Jul 30 '17 at 21:29










2 Answers
2






active

oldest

votes


















0














You can create a chroot list with vsftpd.conf
Check this



All the users belonging to ftp-users group goes into /home/ftp-docs/ftp_stuff by default when they login. They cannot navigate in other directories and are restricted to this particular directory.



You do this:



Create a directory by issuing the following command as root:



mkdir -p /home/ftp-docs/ftp_stuff


Then do this:-



chgrp ftp-users /home/ftp-docs/ftp_stuff chmod 3777 /home/ftp-docs/ftp_stuff


In the /etc/vsftpd/vsftpd.conf write this chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list



Put all you ftp-users group userś name in /etc/vsftpd.chroot_list Then in the /etc/passwd file make the home directory of all the users belonging to ftp-users group to /home/ftp-docs/ftp_stuff. Then do the following:



service vsftpd restart


Then login via any user belonging to ftp-users group you will lend into /home/ftp-docs/ftp_stuff. You cant go to the other higher level directories.



you can create multiple entries in the list for multiple groups. the order in which those groups are in the list file will dictate their highest directory I believe.






share|improve this answer





















  • I'm not trying to jail my users to a specific directory. I'm trying to have all users go to the / directory upon authentication.
    – Fre_d
    Mar 2 '16 at 11:15



















0














Just add this line to /etc/vsftpd.conf:



local_root=/


Essentially, you can set it to whatever directory you want. You also can use $USER in the path, it will be replaced with user's login.



So, if you set local_root, for example, to /home/$USER/ftp, then when a user connects to your server, he will be directed to the ftp folder in his home directory.






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%2f741164%2fhow-to-change-vsftpds-default-directory-to-instead-of-the-users-home-directo%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    You can create a chroot list with vsftpd.conf
    Check this



    All the users belonging to ftp-users group goes into /home/ftp-docs/ftp_stuff by default when they login. They cannot navigate in other directories and are restricted to this particular directory.



    You do this:



    Create a directory by issuing the following command as root:



    mkdir -p /home/ftp-docs/ftp_stuff


    Then do this:-



    chgrp ftp-users /home/ftp-docs/ftp_stuff chmod 3777 /home/ftp-docs/ftp_stuff


    In the /etc/vsftpd/vsftpd.conf write this chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list



    Put all you ftp-users group userś name in /etc/vsftpd.chroot_list Then in the /etc/passwd file make the home directory of all the users belonging to ftp-users group to /home/ftp-docs/ftp_stuff. Then do the following:



    service vsftpd restart


    Then login via any user belonging to ftp-users group you will lend into /home/ftp-docs/ftp_stuff. You cant go to the other higher level directories.



    you can create multiple entries in the list for multiple groups. the order in which those groups are in the list file will dictate their highest directory I believe.






    share|improve this answer





















    • I'm not trying to jail my users to a specific directory. I'm trying to have all users go to the / directory upon authentication.
      – Fre_d
      Mar 2 '16 at 11:15
















    0














    You can create a chroot list with vsftpd.conf
    Check this



    All the users belonging to ftp-users group goes into /home/ftp-docs/ftp_stuff by default when they login. They cannot navigate in other directories and are restricted to this particular directory.



    You do this:



    Create a directory by issuing the following command as root:



    mkdir -p /home/ftp-docs/ftp_stuff


    Then do this:-



    chgrp ftp-users /home/ftp-docs/ftp_stuff chmod 3777 /home/ftp-docs/ftp_stuff


    In the /etc/vsftpd/vsftpd.conf write this chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list



    Put all you ftp-users group userś name in /etc/vsftpd.chroot_list Then in the /etc/passwd file make the home directory of all the users belonging to ftp-users group to /home/ftp-docs/ftp_stuff. Then do the following:



    service vsftpd restart


    Then login via any user belonging to ftp-users group you will lend into /home/ftp-docs/ftp_stuff. You cant go to the other higher level directories.



    you can create multiple entries in the list for multiple groups. the order in which those groups are in the list file will dictate their highest directory I believe.






    share|improve this answer





















    • I'm not trying to jail my users to a specific directory. I'm trying to have all users go to the / directory upon authentication.
      – Fre_d
      Mar 2 '16 at 11:15














    0












    0








    0






    You can create a chroot list with vsftpd.conf
    Check this



    All the users belonging to ftp-users group goes into /home/ftp-docs/ftp_stuff by default when they login. They cannot navigate in other directories and are restricted to this particular directory.



    You do this:



    Create a directory by issuing the following command as root:



    mkdir -p /home/ftp-docs/ftp_stuff


    Then do this:-



    chgrp ftp-users /home/ftp-docs/ftp_stuff chmod 3777 /home/ftp-docs/ftp_stuff


    In the /etc/vsftpd/vsftpd.conf write this chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list



    Put all you ftp-users group userś name in /etc/vsftpd.chroot_list Then in the /etc/passwd file make the home directory of all the users belonging to ftp-users group to /home/ftp-docs/ftp_stuff. Then do the following:



    service vsftpd restart


    Then login via any user belonging to ftp-users group you will lend into /home/ftp-docs/ftp_stuff. You cant go to the other higher level directories.



    you can create multiple entries in the list for multiple groups. the order in which those groups are in the list file will dictate their highest directory I believe.






    share|improve this answer












    You can create a chroot list with vsftpd.conf
    Check this



    All the users belonging to ftp-users group goes into /home/ftp-docs/ftp_stuff by default when they login. They cannot navigate in other directories and are restricted to this particular directory.



    You do this:



    Create a directory by issuing the following command as root:



    mkdir -p /home/ftp-docs/ftp_stuff


    Then do this:-



    chgrp ftp-users /home/ftp-docs/ftp_stuff chmod 3777 /home/ftp-docs/ftp_stuff


    In the /etc/vsftpd/vsftpd.conf write this chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list



    Put all you ftp-users group userś name in /etc/vsftpd.chroot_list Then in the /etc/passwd file make the home directory of all the users belonging to ftp-users group to /home/ftp-docs/ftp_stuff. Then do the following:



    service vsftpd restart


    Then login via any user belonging to ftp-users group you will lend into /home/ftp-docs/ftp_stuff. You cant go to the other higher level directories.



    you can create multiple entries in the list for multiple groups. the order in which those groups are in the list file will dictate their highest directory I believe.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Mar 2 '16 at 11:07









    KPK

    11




    11












    • I'm not trying to jail my users to a specific directory. I'm trying to have all users go to the / directory upon authentication.
      – Fre_d
      Mar 2 '16 at 11:15


















    • I'm not trying to jail my users to a specific directory. I'm trying to have all users go to the / directory upon authentication.
      – Fre_d
      Mar 2 '16 at 11:15
















    I'm not trying to jail my users to a specific directory. I'm trying to have all users go to the / directory upon authentication.
    – Fre_d
    Mar 2 '16 at 11:15




    I'm not trying to jail my users to a specific directory. I'm trying to have all users go to the / directory upon authentication.
    – Fre_d
    Mar 2 '16 at 11:15













    0














    Just add this line to /etc/vsftpd.conf:



    local_root=/


    Essentially, you can set it to whatever directory you want. You also can use $USER in the path, it will be replaced with user's login.



    So, if you set local_root, for example, to /home/$USER/ftp, then when a user connects to your server, he will be directed to the ftp folder in his home directory.






    share|improve this answer


























      0














      Just add this line to /etc/vsftpd.conf:



      local_root=/


      Essentially, you can set it to whatever directory you want. You also can use $USER in the path, it will be replaced with user's login.



      So, if you set local_root, for example, to /home/$USER/ftp, then when a user connects to your server, he will be directed to the ftp folder in his home directory.






      share|improve this answer
























        0












        0








        0






        Just add this line to /etc/vsftpd.conf:



        local_root=/


        Essentially, you can set it to whatever directory you want. You also can use $USER in the path, it will be replaced with user's login.



        So, if you set local_root, for example, to /home/$USER/ftp, then when a user connects to your server, he will be directed to the ftp folder in his home directory.






        share|improve this answer












        Just add this line to /etc/vsftpd.conf:



        local_root=/


        Essentially, you can set it to whatever directory you want. You also can use $USER in the path, it will be replaced with user's login.



        So, if you set local_root, for example, to /home/$USER/ftp, then when a user connects to your server, he will be directed to the ftp folder in his home directory.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 4 '18 at 13:17









        Nullcaller

        11




        11






























            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.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • 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%2f741164%2fhow-to-change-vsftpds-default-directory-to-instead-of-the-users-home-directo%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

            flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

            Mangá

             ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕