logo superhost
logo superhost

Khuyến mãi mới

Chưa có khuyến mãi mới
Xem tất cả

Thông báo mới

SuperHost không có tin mới
Quý khách không có tin mới
Xem tất cả
  • Home
  • Store  
    • Browse All
    • -----
    • Cloud Server
    • Hosting Linux
    • Business Hosting
    • Super Hosting
    • SEO Hosting
    • Reseller Hosting
    • Dedicated Server
    • Colocations
    • Backup Services
    • Chứng thư số SSL
    • Email theo tên miền
    • License Services
    • Quản trị máy chủ
    • Hosting miễn phí
    • Register a New Domain
    • Transfer Domains to Us
  • Knowledgebase
  •   submitticketmore
      • Việt Nam
      • English
  • Account  
    • Login
    • mkmbreadcuum
    • cmndbreadcuum
    • quanlyvat
    • Register
    • -----
    • Forgot Password?
  1. Portal Home
  2. Knowledgebase
  3. Bảo mật
  4. Secure tmp folder openvz

  Categories

0
AAPanel
1
Almalinux
13
Bảo mật
28
Cloud Server
1
CyberPanel
17
Cơ sở dữ liệu MySQL
9
Datasheet
31
Dịch vụ Hosting
34
Dịch vụ máy chủ riêng
11
Dịch vụ đại lý hosting
3
DirectAdmin
3
FTP
20
Hướng dẫn E-mail
6
Hướng dẫn thanh toán
26
Khuyến mãi
2
Lập trình PHP
45
Lỗi nhỏ thường gặp
98
Quản lý VPS
2
Qui định & Chính sách
5
Reset mật khẩu
4
Sao lưu dữ liệu
11
Sử dụng .htaccess
7
Sử dụng Kloxo
16
Sử dụng mControl
12
Sử dụng Trung tâm KH
8
Sử dụng Wordpress
4
SEO Hosting
12
Tên miền
1
Tuyển dụng
10
Upload website
3
Video hướng dẫn

  Categories

Secure tmp folder openvz

How to secure /tmp, /var/tmp and /dev/shm with OpenVZ

First open fstab using nano, or your chosen editor:

nano -w /etc/fstab

 

Next append the following like to the fstab file you just opened:

none /tmp tmpfs nodev,nosuid,noexec 0 0

 

If you opened using nano you can now close using ctrl+x and then answering “y” to save.

To apply the changes we now need to simply remount all:

mount -a

Then secure /dev/shm:

change 

none    /dev/shm        tmpfs   defaults     0 0

to 

none    /dev/shm        tmpfs   nodev,nosuid,noexec     0 0

and save file.

Then use command:

mount -o remount /dev/shm  

to update mount options for /dev/shm

now mount command should show you something like:

mount 


/dev/simfs on / type reiserfs (rw,usrquota,grpquota)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
none on /dev type tmpfs (rw)
none on /dev/pts type devpts (rw)
none on /dev/shm type tmpfs (rw,noexec,nosuid,nodev)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
none on /tmp type tmpfs (rw,noexec,nosuid,nodev)


and you could see that /tmp and /de/shm now secured.

There is also a /var/tmp dir that needs to be secured.

So first make a backup of the files in the folder:

mv /var/tmp /var/tmpfiles

 

Now make a symlink to map /tmp to /var/tmp

ln -s /tmp /var/tmp

 

next is to restore the files from the backup we have made before:

cp /var/tmpfiles/* /tmp/

 

Restore the files from the backup you made before, and make sure that the files in tmpfiles are now in tmp.

ls -la /var/tmpfiles

ls -la /var/tmp

 

You can remove the tmpfiles directory now with the following Linux command:

rm -rf /var/tmpfiles

Was this answer helpful?

 Print this Article

Also Read

View: 5655
CA Bundle Rapid SSL

Vào link sau để lấy CA Bundlehttps://knowledge.digicert.com/generalinformation/INFO1548.html

View: 10784
Bảo mật SSL cho trung tâm khách hàng

Khi đăng nhập vào hệ thống SuperHost, tài khoản quý khách sẽ được bảo vệ bởi việc mả hóa dữ liệu...

View: 10248
Enable chức năng Security Question của Cpanel

Tất cả các máy chủ WHM của SuperHost đều được cấu hình bảo mật khi đăng nhập. Vì vậy khi đăng...

View: 11316
Disable chức năng Security Question của Cpanel

Vì quên câu trả lời, bạn có thể tạm thời tắt chức năng này: 1) Login as a root user using SSH...

View: 11596
Bảo vệ thư mục trên host bằng username và password

Bài này hướng dẫn cho các bạn cách bảo vệ thư mục của mình trên host, không cho bất kỳ ai truy...

Powered by WHMCompleteSolution

SuperHost logo
CÔNG TY TNHH SUPERHOST
  Tòa nhà số 104, Đường số 6, KDC CityLand Park Hills, P.10, Q.Gò Vấp, Tp.Hồ Chí Minh
  sales@superhost.vn
  (028) - 73002073
SuperHost
Giới thiệu doanh nghiệp
Liên hệ
Cổng thanh toán
Blog
Tuyển dụng
Qui định sử dụng
Chính sách hoàn tiền
DỊCH VỤ
Linux Hosting
Domain
Dedicated Server
Cloud Server
SSL Certificates
Website
Colocation
CÔNG CỤ
Abuse IP – Báo cáo IP
Kiểm tra IP máy tính
SSL Checker
Tạo Key và CSR cho SSL
Kiểm tra email tồn tại
SuperHost logo
© SuperHost 2011 All Rights Reserved.   (Đường dây nóng) 0931150780, (Tổng đài) (028) - 73002073

Title

Loading...
Loading...
LiveZilla Live Help
Chát với chúng tôi