The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

secure /tmp directory

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

  1. jimlongo

    jimlongo Well-Known Member

    Joined:
    Mar 20, 2008
    Messages:
    145
    Likes Received:
    2
    Trophy Points:
    18
    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:
    6
    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 [~]#
     
  3. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    that's because you on a a openvz/Virtuozzo VPS you cant run it
     
  4. Spetsnaz

    Spetsnaz Well-Known Member

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

    ItsMattSon Well-Known Member

    Joined:
    Sep 5, 2016
    Messages:
    73
    Likes Received:
    16
    Trophy Points:
    8
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm happy to see you were able to address the issue. Thank you for updating us with the outcome.
     
Loading...

Share This Page