OMV 7.5.2-1 - root SSH path environment variable does not pass when su from a regular user

  • It appears that the root SSH path environment variable is different when logging in directly as root vs logging in as another SSH user and then using "su" or "su root". The path environment variable for "omv-firstaid" is not defined when logging in as another SSH user and then using "su" or "su root" to become the root user and the shell returns "command not found" if you try to run "omv-firstaid" without its path in front.


    This has been verified using the "which omv-firstaid" command, nothing is returned in the case. Additionally the command does work properly if you execute "sudo omv-firstaid" while root. Seems silly to have to use sudo as the root user...


    When logging in directly as root, the "which omv-firstaid" command returns the proper result "/usr/sbin/omv-firstaid".

  • tgbanshee

    Changed the title of the thread from “BUG - OMV 7.5.2-1 - root SSH environment variables do not pass when su from a regular user” to “BUG - OMV 7.5.2-1 - root SSH path environment variable does not pass when su from a regular user”.
  • crashtest

    Approved the thread.
    • Official Post

    This is not a bug. When you use su or su root instead su - or su - root, you are using your profile instead of root's profile. This is not unique to OMV or Debian or even Linux.

    omv 8.0.6-2 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.2 | compose 8.1.2 | cterm 8.0 | borgbackup 8.0.2 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • ryecoaaron

    Changed the title of the thread from “BUG - OMV 7.5.2-1 - root SSH path environment variable does not pass when su from a regular user” to “OMV 7.5.2-1 - root SSH path environment variable does not pass when su from a regular user”.
  • Thank

    This is not a bug. When you use su or su root instead su - or su - root, you are using your profile instead of root's profile. This is not unique to OMV or Debian or even Linux.

    Thank you. Somehow I've missed this detail after many many years of using POSIX-compliant operating systems. Learn something new every day!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!