How to set default login directory open for ftp user

    • OMV 1.0

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • How to set default login directory open for ftp user

      Hi,

      I have setup FTP from this old guide

      phpbb.openmediavault.org/viewtopic.php?f=13&t=3205

      Everything works fine except i need to cd to the share "ftp" before i can put anything as ftp user.

      my sharefolder is called ftp, so when i login from one of the ftp users i see this

      ftp> ls -la
      229 Entering Extended Passive Mode (|||14103|)
      150 Opening ASCII mode data connection for file list
      drwxr-xr-x 2 ftp nogroup 4096 Sep 19 18:16 .
      drwxr-xr-x 2 ftp nogroup 4096 Sep 19 18:16 ..
      drwxrwsr-x 2 root users 4096 Sep 21 09:46 ftp

      Now i need to cd to the ftp directory still to be able to write, i can't write anything where i am now.

      So my question is how can i set it in the config so that when i login with ftp i get straight into the writeable ftp directory


      Thanks,
      Armand


      EDIT: i found this in man page

      The DefaultRoot directive controls the default root directory assigned to a user upon login. If DefaultRoot is set to a directory other than "/", a chroot operation is performed immediately after a client authenticates. This can be used to effectively isolate the client from a portion of the host system filespace. The specified root directory must begin with a / or can be the magic character '~'; meaning that the client is chroot jailed into their home directory.

      So i will try to set this, but what is the value then of the vroot in config file is that to set more shares which can be available for the ftp users?
    • Have you tried using symlinks to work around the fixed DefaultRoot path?

      Greetings
      David
      "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"

      Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.


      Upload Logfile via WebGUI/CLI
      #openmediavault on freenode IRC | German & English | GMT+1
      Absolutely no Support via PM!

      I host parts of the omv-extras.org Repository, the OpenMediaVault Live Demo and the pre-built PXE Images. If you want you can take part and help covering the costs by having a look at my profile page.
    • Well, it can't do that the way it is implemented. It can respect changes that are supposed to be changeable via CLI... there are some files for it. Maybe create a feature request for that on the bugtracker and Volker will implement it for you.

      Greetings
      David
      "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"

      Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.


      Upload Logfile via WebGUI/CLI
      #openmediavault on freenode IRC | German & English | GMT+1
      Absolutely no Support via PM!

      I host parts of the omv-extras.org Repository, the OpenMediaVault Live Demo and the pre-built PXE Images. If you want you can take part and help covering the costs by having a look at my profile page.
    • symlinks in proftpd work only in the chrooted enviroment. That's only if the directive that allows that is present. There is a way to go around the chroot enviroment but that's not the idea of the omv ftp server.
      Have you set the privileges in the shared folder ?
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server
    • Subzero has given you the perfect answer to your question, even before you asked.

      Greetings
      David
      "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"

      Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.


      Upload Logfile via WebGUI/CLI
      #openmediavault on freenode IRC | German & English | GMT+1
      Absolutely no Support via PM!

      I host parts of the omv-extras.org Repository, the OpenMediaVault Live Demo and the pre-built PXE Images. If you want you can take part and help covering the costs by having a look at my profile page.
    • Wait, you want to set ftp to the users home folder?

      Or do you want to symlink something to the ftproot?

      Greetings
      David
      "Well... lately this forum has become support for everything except omv" [...] "And is like someone is banning Google from their browsers"

      Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.


      Upload Logfile via WebGUI/CLI
      #openmediavault on freenode IRC | German & English | GMT+1
      Absolutely no Support via PM!

      I host parts of the omv-extras.org Repository, the OpenMediaVault Live Demo and the pre-built PXE Images. If you want you can take part and help covering the costs by having a look at my profile page.
    • Putin is crazy. So nice how he likes to kill people from his own ethnic group and shoot down innocent people on commercial flights... Russia could be part of NATO by now but it will never happen with this idiot. The West had great hopes that Russia would come back and be part of Western Civilization again.... sad...

      Putin height 1.7 meters
      Medvedev height 1.62 meters

      Maybe they got bullied as kids...
    • stalkerxxl wrote:

      I use the home directory for the user in the tab-settings "users"
      Samba - goes perfectly right in the user's home directory

      And how to do that on a ftp - is also connect in the same user's home directory (/hdd1/users/*username*)?


      Make the user home folder a share, then pick that share an add it to the ftp shares.
      As for your auto login & cd to that folder (user home folder), the simplest way to do it is set the client software to CD into that folder after first login. WINscp can do it, also filezilla.
      As an auto option (without the client setup), all I can think if of the mod_exec module in proftpd (and I am not sure if it will work), but I believe it comes disabled (not build into) OMV. @tekkb is the proftpd ninja so maybe he has a better idea
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server
    • Hi,

      i think this Is the same Problem l have with my silly cam : FTP Share for Webcam (Wansview)?

      Jochen
      omv 1.14 kralizec | 64 bit | 3.16 backport kernel | omvextrasorg 1.13
      Plugins: Virtualbox, VDR (e-toby 2.2, jessie, manual), OwnCloud, Backup, MiniDLNA, Openvpnas, MySQL, USB Datasave, USV
      HW:Asrock q1900-ITX / 8GB RAM / 60 GB SSD / 2 TB Seagate Green + 2 TB WD Red = RAID 1 / APC Back-UPS CS 350 / Digibit R1 SAT>IP
    • Make the user home folder a share, then pick that share an add it to the ftp shares.As for your auto login & cd to that folder (user home folder), the simplest way to do it is set the client software to CD into that folder after first login. WINscp can do it, also filezilla.As an auto option (without the client setup), all I can think if of the mod_exec module in proftpd (and I am not sure if it will work), but I believe it comes disabled (not build into) OMV. @tekkb is the proftpd ninja so maybe he has a better idea

      Ideally - should be that user's home directory - it is the default directory for the Samba and ftp
      At the moment - i changed DefaultRoot in proftpd.conf

      Maybe in the next version to fix it?

      P.S. Thank you for your understanding of the situation .. we have a lot of victims of kidnappings, looters, etc. .. my friend took the car for what was on the street at night during curfew .. and two weeks were forced to dig trenches and strengthening .. But we still win! Ukraine forever!
      omv 1.0.29 kralizec | 64 bit | 3.2.0-4 kernel | omvextrasorg 1.0.13 (Sorry for my bad english...)
    • The best and easiest was for me to change the DefaultRoot, like also Stalker did but the problem is as i made the mistake again to change a ftp share in BUI and my DefaultRoot was changed again :(
      I need to search for a permanent solution where i am able to right in the directory when i login as ftp user on the path i have set.
      Going to delete all my config and give it another try.
    • All the default values of proftpd can be changed with environmental variables at /etc/default/openmediavault file.
      Those variable names can be obtained from the code that does mkconf for proftpd. They all start "OMV_", like OMV_PROFTPD_DEFAULTROOT.

      Modify them at youre own risk, however you can always revert by commenting those overriden values at the file mentioned above. Also you will find better support for different values at the proftpd documentation site.
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server
    • Ok i found that file now i was looking on wrong server.

      I have add the following line:
      OMV_PROFTPD_DEFAULTROOT= <path-to-volume>/Public

      Going to test it now, what i do not understand why OMV is not making it default to for example a chroot like putting

      OMV_PROFTPD_DEFAULTROOT=~

      Because just using the /srv/ftp makes it impossible to write in the directory you are when login in and some programs like webcams do not support chdir.


      The post was edited 1 time, last by ArmandH ().

    • After setting the OMV_PROFTPD_DEFAULTROOT in the /etc/default/openmediavault file and reboot did not change the defaultroot in
      /etc/proftpd/proftpd.conf :(

      Maybe this is a bug !!!

      When i went into the BUI and just changed a setting in the ftp section and save and after that checked again the /etc/proftpd/proftpd.conf i saw that the DefaultRoot i had set in the openmediavault file suddenly appeared.

      I do not know if this is default behavior but i find it a little weird that a change and reboot didn't pick up the change, but changing a setting in the BUI of ftp and save did.

      Anyway now i have finally my DefaultRoot set the way i want it.
    • Thats is not a bug, a manual change in proftpd.conf is not going to be reboot persistent
      I've tested this weeks ago, and it worked. Did you use quotes in variable "/example_topath" ?
      after that you need to output the configuration with omv-mkconf proftpd, and reload proftpd.
      OMV does not create shares outside of the mounted volumes/drives, also it does not create shares from the system drive, but that can be circumvented with symlinks.
      What exactly do you want achieve? you want to write just to the root of the FTP?
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server