Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SOLVED secure /tmp directory

Discussion in 'Security' started by jimlongo, Jan 15, 2013.

  1. jimlongo

    jimlongo Well-Known Member

    Joined:
    Mar 20, 2008
    Messages:
    211
    Likes Received:
    10
    Trophy Points:
    68
    Tried to run the following script on a CentOS VPS
    Code:
    # /scripts/securetmp 
    *** Notice *** No loop module detected
    If the loopback block device is built as a module, try running `modprobe loop` as root via ssh and running this script again.
    If the loopback block device is built into the kernel itself, you can ignore this message.
    *** Notice *** No working loopback device files found. Try running `modprobe loop` as root via ssh and running this script again.
    
    Then following that instruction
    Code:
    # modprobe loop
    FATAL: Could not load /lib/modules/2.6.18-028stab099.3/modules.dep: No such file or directory
    
    Thanks for any help you can offer.
     
  2. Spetsnaz

    Spetsnaz Well-Known Member

    Joined:
    Jun 25, 2011
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    56
    cPanel Access Level:
    Website Owner
    I am currently having the same issue

    root@server1 [~]# /scripts/securetmp
    *** Notice *** No loop module detected
    If the loopback block device is built as a module, try running `modprobe loop` as root via ssh and running this script again.
    If the loopback block device is built into the kernel itself, you can ignore this message.
    *** Notice *** No working loopback device files found. Try running `modprobe loop` as root via ssh and running this script again.
    root@server1 [~]#
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,741
    Likes Received:
    76
    Trophy Points:
    203
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    that's because you on a a openvz/Virtuozzo VPS you cant run it
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Spetsnaz

    Spetsnaz Well-Known Member

    Joined:
    Jun 25, 2011
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    56
    cPanel Access Level:
    Website Owner
    IS there a way to make this work on a OpenVZ VPS?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. ItsMattSon

    ItsMattSon Well-Known Member

    Joined:
    Sep 5, 2016
    Messages:
    167
    Likes Received:
    34
    Trophy Points:
    103
    Location:
    Perth
    cPanel Access Level:
    Root Administrator
    BUMP

    I'm experiencing this same issue because I'm on an OpenVZ VPS and can't run /scripts/securetmp without hitting this response either.

    Is there a way to secure tmp on OpenVZ VPS or is there no solution for us?

    EDIT: Apologies, found this online which I believe answered my question. Where it says to remount though, /tmp was never mounted so i used "mount /tmp".

    "On an OpenVZ VPS you will need to do the following to secure /tmp and /var/tmp.

    Secure /tmp

    1. Edit /etc/fstab by typing the command nano -w /etc/fstab
    2. Paste the following at the bottom of /etc/stab that you just opened: none /tmp tmpfs nodev,nosuid,noexec 0 0
    3. Press ctrl + x to close the file, press y to save it.
    4. Remount /tmp by typing the following then press enter: mount -o remount /tmp
    5. You can verify that /tmp is correctly mounted by typing df -h and you should see something similar to the following: none 3.9G 0 3.9MG 0% /tmp.
    Secure /var/tmp

    1. Backup /var/tmp by typing the following: mv /var/tmp /var/tmpbackup
    2. Make a symbolic link that makes /var/tmp point to /tmp by typing the following: ln -s /tmp /var/tmp
    3. Copy back the old data using the command: cp /var/tmpbackup/* /tmp/
    4. Remove the un-needed backup you created: rm -rf /var/tmpbackup
    You should now reboot your VPS. This means /tmp and /var/tmp are now secured."
     
    #5 ItsMattSon, Oct 16, 2016
    Last edited: Oct 16, 2016
    cPanelMichael likes this.
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,802
    Likes Received:
    1,895
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    I'm happy to see you were able to address the issue. Thank you for updating us with the outcome.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice