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!

Suspicious file in /var/tmp/.X1-unix

Discussion in 'Security' started by postcd, Oct 1, 2015.

  1. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    694
    Likes Received:
    15
    Trophy Points:
    68
    Hello,

    i want to ask i got warning from firewall:

    File: /var/tmp/.X1-unix
    Reason: Suspicious directory

    it has rights of one of the cpanel accounts. i want to ask what is this /var/tmp and how it could create this file, how to prevent?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. 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
    /var/tmp is /tmp

    is symbolically linked
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. lx24

    lx24 Member

    Joined:
    Oct 2, 2014
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    You can find many threads around the fourm regarding securing tmp folder.

    Use : /scripts/securetmp
     
  4. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    694
    Likes Received:
    15
    Trophy Points:
    68
    /scripts/securetmp failes because OpenVZ which im using do not work with "loop devices", you taking like there can be more ways on how to secure /tmp, what are other ways except using loop device/s? thank you
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. lx24

    lx24 Member

    Joined:
    Oct 2, 2014
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Under VPS edit /etc/fstab,

    nano /etc/fstab

    and insert below lines,

    Code:
    mount /dev/loop0 -o noexec,nosuid,rw /dev/tmpFS /tmp
    mount /dev/loop0 /dev/tmpFS -o noexec,nosuid,rw
    Now run command below,

    Code:
    mount -obind,nosuid,noexec,nodev,rw /usr/tmp /tmp
    You /tmp is mounted now with noexec

    secure!
     
  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 :)

    Feel free to try the steps offered in the previous post and let us know if that helps.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    694
    Likes Received:
    15
    Trophy Points:
    68
    I want to try it and update this thread with results, but can You please tell me what it basically do? How i can safelly revert that process? Thank you
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. quizknows

    quizknows Well-Known Member

    Joined:
    Oct 20, 2009
    Messages:
    1,011
    Likes Received:
    88
    Trophy Points:
    78
    cPanel Access Level:
    DataCenter Provider
    I would advise against editing your /etc/fstab unless you are fully aware of the changes you are making and the implications of them. You can backup the file first before editing it and revert, however, you are changing file system mounting configuration by editing that file.

    If in doubt consult with your host. You mention that /scripts/securetmp fails due to lack of support for loop devices on your virtualiztaion platform: the advice given is using
    /dev/loop0 which will likely not work if the securetmp script does not work.
     
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