نمایش نتایج: از شماره 1 تا 2 , از مجموع 2

موضوع: امن کردن پارتیشن /tmp در سرور های CPANEL

Threaded View

پست قبلی پست قبلی   پست بعدی پست بعدی
  1. #1
    مدیر کل Vahid آواتار ها
    تاریخ عضویت
    Aug 2008
    نوشته ها
    2,724
    تشکر تشکر کرده 
    435
    تشکر تشکر شده 
    6,976
    تشکر شده در
    2,085 پست

    پیش فرض امن کردن پارتیشن /tmp در سرور های CPANEL

    If you are renting a server then chances are everything is lumped in / and a small amount partitioned for /boot and some for swap. With this current setup, you have no room for making more partitions unless you have a second hard-drive. Learn how to create a secure /tmp partition even while your server is already up and running.
    Recently, I found out it would be worthwhile to give /tmp it's own partition and mount it using noexec- This would protect your system from MANY local and remote exploits of rootkits being run from your /tmp folder.

    What we are doing it creating a file that we will use to mount at /tmp. So log into SSH and SU to root so we may being! code:
    cd /dev
    Create 100MB file for our /tmp partition. If you need more space, make count size larger.

    code:
    dd if=/dev/zero of=tmpMnt bs=1024 count=100000
    Make an extended filesystem for our tmpMnt file
    code:
    /sbin/mke2fs /dev/tmpMnt
    Backup your /tmp dir- I had mysql.sock file that I needed to recreate the symbolic link for. Other programs may use it to store cache files or whatever.

    code:
    cd /

    Article provided by WebHostGear.com

    code:
    cp -R /tmp /tmp_backup Mount the new /tmp filesystem with noexec
    code:
    mount -o loop,noexec,nosuid,rw /dev/tmpMnt /tmp
    code:
    chmod 1777 /tmp
    Copy everything back to new /tmp and remove backup
    code:
    cp -R /tmp_backup/* /tmp/
    code:
    rm -rf /tmp_backup
    Now we need to add this to fstab so it mounts automatically on reboots.
    code:
    pico -w /etc/fstab
    You should see something like this:
    code:
    /dev/hda3 / ext3 defaults,usrquota 1 1
    /dev/hda1 /boot ext3 defaults 1 2
    none /dev/pts devpts gid=5,mode=620 0 0
    none /proc proc defaults 0 0
    none /dev/shm tmpfs defaults 0 0
    /dev/hda2 swap swap defaults 0 0

    At the bottom add
    code:
    /dev/tmpMnt /tmp ext2 loop,noexec,nosuid,rw 0 0

    (Each space is a tab)
    Save it!
    Ctrl + X and Y
    Your done- /tmp is now mounted as noexec. You can sleep a little bit safer tonight. I created a hello world c++ and compiled it then moved it to /tmp. Upon trying to run it (even chmod +x'ed), it gives the following error:
    code:
    bash: ./a.out: Permission denied
    Yay! /tmp no longer has execute permissions :-D
    برای پیش رفت در علم آسانسوری وجود ندارد پله ها را باید پیاده رفت /./ همیشه این یادتان باشد که دست بالای دست بسیار است.
    يادمان باشد براي يك بار ايستادن صد ها بار افتاده ايم /./ بک آپ مهمترین رمز موفقیت هاستینگ /./ امنیت مطلق نیست.
    ارتباط مستقیم با من :
    Admin -{(@)}- WebHostingTalk . ir

  2. تعداد تشکر ها ازVahid به دلیل پست مفید


اطلاعات موضوع

کاربرانی که در حال مشاهده این موضوع هستند

در حال حاضر 1 کاربر در حال مشاهده این موضوع است. (0 کاربران و 1 مهمان ها)

موضوعات مشابه

  1. کمک از اساتید در cpanel
    توسط a b e l در انجمن سی پنل CPanel
    پاسخ ها: 2
    آخرين نوشته: April 19th, 2018, 20:37
  2. پایان زمان پشتیبانی cPanel & WHM ورژن 54
    توسط rouhallah در انجمن سی پنل CPanel
    پاسخ ها: 1
    آخرين نوشته: December 31st, 2016, 09:54
  3. پارتیشن بندی لینوکس قبل از نصب cpanel
    توسط stronger در انجمن سوالات و مشکلات
    پاسخ ها: 4
    آخرين نوشته: January 21st, 2016, 00:41
  4. بهترین پارتیشن بندی برای نصب CPanel
    توسط qqww در انجمن سوالات و مشکلات
    پاسخ ها: 8
    آخرين نوشته: June 5th, 2015, 04:03
  5. هاستیگ پشتیبان - 10% تخفیف - Cpanel - سرور جدید
    توسط poshtiban در انجمن فروش هاست اشتراکی
    پاسخ ها: 2
    آخرين نوشته: May 21st, 2012, 17:41

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •