Sau khi boot vào chế độ single mode và tiến hành đổi mật khẩu tài khoản root bằng lệnh passwd thì báo lỗi: " cannot identify you"
Để xử lý lỗi này ta tiến hành tắt dịch vụ SELINUX bằng cách mở tập tin /etc/sysconfig/selinux
Trong mục SELINUX chỉnh thành "disabled"
Khởi động lại máy chủ và vào lại chế độ single mode để tiến hành đổi mật khẩu bằng lệnh passwd
Thứ Sáu, 7 tháng 7, 2017
Thứ Tư, 14 tháng 6, 2017
Quản lý và giới hạn CPU trên từng process trên Ubuntu
Bước 1: Cài công cụ CPUTool
Code:
$ sudo apt install cputool
Code:
# cputool --cpu-limit 50 -p 8275
Bước 3: Để giới hạn CPU của một nhóm các tiến trình liên quan
Tìm các tiến trình liên quan đến ứng dụng
Code:
# pidof apache2 9592 3643 3642 3641 3640 3638 3637 1780
Code:
# cputool --cpu-limit 20 -P 1780
Code:
# cputool --load-limit 3.5 --rsync -av /home/tecmint /backup/`date +%Y-%m-%d`/
Các cách phòng chống WANNACRY ransomware
Cách 1. Cập nhật Windows
Đây là điều đầu tiên các bạn cần làm đối với máy tính hay VPS/Server của mình. Trong một số trường hợp, việc cập nhật tốn quá nhiều thời gian và có thể gây ra lỗi do mất kết nối. Các bạn có thể tải các bản cập nhật đặc biệt theo các đường dẫn dưới đây.
Windows 10 x64 1607
http://download.windowsupdate.com/c/msdownload/update/software/secu/2017/03/windows10.0-kb4013429-x64_delta_24521980a64972e99692997216f9d2cf73803b37.msu
http://download.windowsupdate.com/c/msdownload/update/software/secu/2017/03/windows10.0-kb4013429-x64_delta_24521980a64972e99692997216f9d2cf73803b37.msu
Windows 8 (security update)
http://download.windowsupdate.com/c/msdownload/update/software/secu/2017/05/windows8-rt-kb4012598-x86_a0f1c953a24dd042acc540c59b339f55fb18f594.msu
http://download.windowsupdate.com/c/msdownload/update/software/secu/2017/05/windows8-rt-kb4012598-x86_a0f1c953a24dd042acc540c59b339f55fb18f594.msu
Windows XP x64 Edition (Security Update for Windows XP SP2 for x64-based Systems)
http://download.windowsupdate.com/d/csa/csa/secu/2017/02/windowsserver2003-kb4012598-x64-custom-enu_f24d8723f246145524b9030e4752c96430981211.exe
http://download.windowsupdate.com/d/csa/csa/secu/2017/02/windowsserver2003-kb4012598-x64-custom-enu_f24d8723f246145524b9030e4752c96430981211.exe
Windows Server 2008 (Security Update for Windows Server 2008 for Itanium-based Systems)
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-ia64_83a6f5a70588b27623b11c42f1c8124a25d489de.msu
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-ia64_83a6f5a70588b27623b11c42f1c8124a25d489de.msu
Windows Vista (Windows Vista Security Update)
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-x86_13e9b3d77ba5599764c296075a796c16a85c745c.msu
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-x86_13e9b3d77ba5599764c296075a796c16a85c745c.msu
Windows Server 2008 (Windows Server 2008 Security Update)
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-x86_13e9b3d77ba5599764c296075a796c16a85c745c.msu
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-x86_13e9b3d77ba5599764c296075a796c16a85c745c.msu
Windows Server 2003, Windows Server 2003, Datacenter Edition (x64 system for Windows Server 2003 security update custom support)
http://download.windowsupdate.com/c/csa/csa/secu/2017/02/windowsserver2003-kb4012598-x64-custom-cht_23a0e14eee3320955b6153ed7fab2dd069d39874.exe
http://download.windowsupdate.com/c/csa/csa/secu/2017/02/windowsserver2003-kb4012598-x64-custom-cht_23a0e14eee3320955b6153ed7fab2dd069d39874.exe
Windows 8 (Windows 8 security update for x64 system)
http://download.windowsupdate.com/c/msdownload/update/software/secu/2017/05/windows8-rt-kb4012598-x64_f05841d2e94197c2dca4457f1b895e8f632b7f8e.msu
http://download.windowsupdate.com/c/msdownload/update/software/secu/2017/05/windows8-rt-kb4012598-x64_f05841d2e94197c2dca4457f1b895e8f632b7f8e.msu
Windows XP Embedde (XPe Windows XP SP3 Security Update Custom Support)
http://download.windowsupdate.com/c/csa/csa/secu/2017/02/windowsxp-kb4012598-x86-embedded-custom-cht_c3696d39aab12713c4bd4e30b8e17f0a03fd8089.exe
http://download.windowsupdate.com/c/csa/csa/secu/2017/02/windowsxp-kb4012598-x86-embedded-custom-cht_c3696d39aab12713c4bd4e30b8e17f0a03fd8089.exe
Windows XP (Windows XP SP3 Security Update Custom Support)
http://download.windowsupdate.com/d/csa/csa/secu/2017/02/windowsxp-kb4012598-x86-custom-cht_a84b778a7caa21af282f93ea0cdada0f7abb7d6a.exe
http://download.windowsupdate.com/d/csa/csa/secu/2017/02/windowsxp-kb4012598-x86-custom-cht_a84b778a7caa21af282f93ea0cdada0f7abb7d6a.exe
Windows Server 2003, Windows Server 2003, Datacenter Edition, Windows Server 2003 Security Update Custom Support)
http://download.windowsupdate.com/c/csa/csa/secu/2017/02/windowsserver2003-kb4012598-x86-custom-Cht_71a7359d308c8bda7638b4dc4ea305e7e22cc4c2.exe
http://download.windowsupdate.com/c/csa/csa/secu/2017/02/windowsserver2003-kb4012598-x86-custom-Cht_71a7359d308c8bda7638b4dc4ea305e7e22cc4c2.exe
Windows Vista (Windows Vista Security Update for x64 Systems)
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-x64_6a186ba2b2b98b2144b50f88baf33a5fa53b5d76.msu
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-x64_6a186ba2b2b98b2144b50f88baf33a5fa53b5d76.msu
Windows Server 2008 (x64 system for Windows Server 2008 security update)
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-x64_6a186ba2b2b98b2144b50f88baf33a5fa53b5d76.msu
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windows6.0-kb4012598-x64_6a186ba2b2b98b2144b50f88baf33a5fa53b5d76.msu
Windows XP Embedded (WES09 and POSReady 2009 Security Update)
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windowsxp-kb4012598-x86-embedded-cht_a827a40579d7de4c78efeca91d25ec0762e1c5be.exe
http://download.windowsupdate.com/d/msdownload/update/software/secu/2017/02/windowsxp-kb4012598-x86-embedded-cht_a827a40579d7de4c78efeca91d25ec0762e1c5be.exe
Cách 2. Tắt SMB trong Windows
Để tắt SMB trong Windows các bạn có thể sử dụng 1 trong 2 cách sau đây
Để tắt SMB trong Windows các bạn có thể sử dụng 1 trong 2 cách sau đây
Sử dụng Power Shell với quyền Administrator
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB1 -Type DWORD -Value 0 -Force Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" SMB2 -Type DWORD -Value 0 -Force
Sử dụng CMD với quyền Administrator
sc.exe config lanmanworkstation depend= bowser/mrxsmb20/nsi sc.exe config mrxsmb10 start= disabled sc.exe config lanmanworkstation depend= bowser/mrxsmb10/nsi sc.exe config mrxsmb20 start= disabled
Sau khi thực hiện xong các bạn nên restart lại máy để cập nhật cấu hình.
Cách 3. Cài đặt Anti Ransomware của Bitdefender
Đây là bản miễn phí, các bạn có thể tải về tại https://www.bitdefender.com/solutions/anti-ransomware-tool.html
Đây là bản miễn phí, các bạn có thể tải về tại https://www.bitdefender.com/solutions/anti-ransomware-tool.html
Thứ Hai, 12 tháng 6, 2017
Nâng cấp Virtuozzo Automator
Bước 1: Nâng cấp Virtuozzo Automator Management Panel, ta ssh vào máy ảo container đang chạy Virtuozzo Automator và gõ lệnh sau:
Bước 2: Nâng cấp Virtuozzo Automator Agent, ta thực hiện trên từng máy chủ Hardware node
Code:
# yum groupupdate "VA Management Node" "VA Control Center"
Code:
# yum groupupdate "VA Agent"
Thứ Sáu, 19 tháng 5, 2017
Hướng dẫn cài đặt Zend Optimizer cho PHP 5.2.x trên Windows
Bước 1: Để cài Zend optimizer vào link này tải :http://www.zend.com/en/products/load...r?package=1453
Bước 2: Giải nén ra và chép file ZendOptimizer.dll vào thư mục ext tại vị trí C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ext\
Bước 3: Mở file php.ini của PHP 5.2.x và thêm vào cuối file dòng sau
[Zend]
zend_extension_ts="C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ext\Zen dOptimizer.dll"
Bước 2: Giải nén ra và chép file ZendOptimizer.dll vào thư mục ext tại vị trí C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ext\
Bước 3: Mở file php.ini của PHP 5.2.x và thêm vào cuối file dòng sau
[Zend]
zend_extension_ts="C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ext\Zen dOptimizer.dll"
Thứ Tư, 17 tháng 5, 2017
Hướng dẫn cấu hình switch Juniper EX2200
Vào chế độ cấu hình
sw> configure
sw#
Hiển thị thông tin tất cả các cổng switchsw# show | display set
Tạo một VLAN cho switchsw#set vlans Vinacis-Metro-1 vlan-id 1217
sw#commit
Gán cổng switch vào VLAN
sw#set interfaces ge-0/0/10 unit 0 family ethernet-switching port-mode access
sw#set interfaces ge-0/0/10 unit 0 family ethernet-switching vlan members Vinacis-Metro-1
sw#commit
Xóa cổng khỏi VLAN
sw#delete interfaces ge-0/0/10 unit 0 family ethernet-switching vlan members Vinacis-Metro-1
sw#commit
Cấu hình trunk trên một interface
sw#set interfaces ge-0/0/22 unit 0 family ethernet-switching port-mode trunk
sw#set interfaces ge-0/0/22 unit 0 family ethernet-switching vlan members Vinacis-Metro-SPT-1
sw#set interfaces ge-0/0/22 unit 0 family ethernet-switching vlan members Vinacis-Metro-SPT-2
sw#commit
Bật SNMP trên switch
sw#set snmp contact "VinaCIS"
sw#set snmp name “Private”
sw#set snmp description “Office”
sw#set snmp location “Rack SE30” contact “email@vinacis.com”
sw#set snmp community public authorization read-only
sw#set snmp client-list list0 210.211.x.x/32
sw#set snmp community public client-list-name list0
sw#commit
sw#show snmp
sw> configure
sw#
Hiển thị thông tin tất cả các cổng switchsw# show | display set
Tạo một VLAN cho switchsw#set vlans Vinacis-Metro-1 vlan-id 1217
sw#commit
Gán cổng switch vào VLAN
sw#set interfaces ge-0/0/10 unit 0 family ethernet-switching port-mode access
sw#set interfaces ge-0/0/10 unit 0 family ethernet-switching vlan members Vinacis-Metro-1
sw#commit
Xóa cổng khỏi VLAN
sw#delete interfaces ge-0/0/10 unit 0 family ethernet-switching vlan members Vinacis-Metro-1
sw#commit
Cấu hình trunk trên một interface
sw#set interfaces ge-0/0/22 unit 0 family ethernet-switching port-mode trunk
sw#set interfaces ge-0/0/22 unit 0 family ethernet-switching vlan members Vinacis-Metro-SPT-1
sw#set interfaces ge-0/0/22 unit 0 family ethernet-switching vlan members Vinacis-Metro-SPT-2
sw#commit
Bật SNMP trên switch
sw#set snmp contact "VinaCIS"
sw#set snmp name “Private”
sw#set snmp description “Office”
sw#set snmp location “Rack SE30” contact “email@vinacis.com”
sw#set snmp community public authorization read-only
sw#set snmp client-list list0 210.211.x.x/32
sw#set snmp community public client-list-name list0
sw#commit
sw#show snmp
Thứ Tư, 10 tháng 5, 2017
Cài đặt tính năng S3 Object storage cho Virtuozzo 6.0
Tính năng S3 Object Storage bao gồm các role sau:
- Object server: lưu trữ dữ liệu được nhận từ S3 gateway. Dữ liệu thực chất được lưu trên virtuozzo storage để bảo đảm tính HA
- Name server: lưu thông tin metada của bucket bao gồm object name, ACL, dung lượng, vị trí, người sở hữu. Dữ liệu thực chất được lưu trên virtuozzo storage để bảo đảm tính HA
- S3 gateway: đóng vai trò là proxy giữa người dùng cuối và các máy chủ object. Nó nhận và xử lý các yêu cầu bằng giao thức Amazon S3 và sử dụng nginx Web server cho các kết nối từ bên ngoài. S3 gateway quản lý việc chứng thực tài khoản user và kiểm tra phân quyền ACL checks. Bản thân nó không sinh ra dữ liệu
- Block level: là virtuozzo storage
Với bài lab này ta triển khai cài đặt 3 role Object Server, Name Server và S3 gateway trên 3 hardware node đang chạy thuộc cụm Virtuozzo 6.0 với thông tin 3 node như sau
Server name: rs00360 - Storage IP: 172.16.10.24 - WAN IP: 103.199.9.24
Server name: rs00361 - Storage IP: 172.16.10.25 - WAN IP: 103.199.9.25
Server name: rs00362 - Storage IP: 172.16.10.26 - WAN IP: 103.199.9.26
Cài đặt Object Server
Bước 1 (thực hiện trên cả 3 node): add thông tin vào file /etc/hosts để phân giải hostname ra IP storage
172.16.10.24 rs00360 rs00360.dinodata.vn
172.16.10.25 rs00361 rs00361.dinodata.vn
172.16.10.26 rs00362 rs00362.dinodata.vn
Bước 2 (thực hiện trên cả 3 node): cài đặt gói pstorage-ostor
Bước 3 (thực hiện trên 1 node sẽ chạy role object server) : Tạo configure service mới và chỉ định số lượng máy chủ sẽ làm object server và name server
<hostname> là tên node đang tiến hành tạo configure service
<cluster_name> là tên cluster của virtuozzo 6.0
<ostor_dir> là thư mục chứa các tập tin của dịch vụ object storage
4 là số lượng node sẽ cài name server
5 là số lượng node sẽ cài storage object
Bước này hệ thống sẽ yêu cầu đặt mật khẩu
Trong bài này ta gõ lệnh sau:
Bước 4: khởi động configure service
Bước 5 (thực hiện trên 1 node sẽ chạy role object server): Khởi tạo kho lưu trữ object storage
Thư mục <ostor_dir> đã qui định ở bước 3 sẽ được tạo tại bước này. Đồng thời bạn cần nhập mật khẩu đã đặt ở bước 3
Trong bài này ta gõ lệnh sau:
Bước 6 (thực hiện trên các node sẽ chạy role object server): thêm các host vào cụm
Trong bài này ta gõ lệnh sau:
Bước 7 (thực hiện trên tất cả các node sẽ làm S3 gateway):
Trong bài này ta gõ ba lệnh sau trên 3 node
Bước 8 (thực hiện trên tất cả các node sẽ làm S3 gateway): Khởi động agent
Bước 9: Kiểm tra trạng thái của hệ thống
Bước 10 (thực hiện trên tất cả các node sẽ làm S3 gateway): Cài đặt và cấu hình Nginx
Cài đặt Nginx
Cấu hình Nginx: Mở file /etc/nginx/conf.d/default.conf và nhập nội dung như bên dưới
Bước 11: Tạo DNS record s3.vinacis.com trỏ về 3 IP Public của 3 node đang chạy S3 gateway
Bước 12: Khởi động dịch vụ Nginx
Bước 13 (thực hiện một trong những node chạy S3) : Tạo tài khoản người dùng S3
Ghi lại thông tin Access Key và Secret Access Key dùng để kết nối tạo Bucket
Bước 14: Khởi tạo Bucket mới
Hệ thống Virtuozo 6.0 không có công cụ để khởi tạo Bucket nên ta cần dùng công cụ của hãng thứ 3. Tải về và cài đặt công cụ CloudBerry Explorer for Amazon S3 tại địa chỉ: http://www.cloudberrylab.com/downloa...prod=cbes3free
Mở phần mềm CloudBerry Explorer for Amazon S3 --> File --> Add New Account --> S3 Compatible --> Điền các thông tin như sau
Display name: đặt tên cho kết nối. VD: vinacis
Service point: điền thông tin kết nối đến S3 Gateway. Trong trường hợp này là s3.vinacis.com:80Access key: điền access key lấy được ở bước 13
Secret key: điền Secret access key lấy được ở bước 13
Lưu ý bỏ dấu check ở hai tùy chọn "Use SSL" và "Use native multipath.."
Sau khi kết nối thì tạo Bucket mới
- Object server: lưu trữ dữ liệu được nhận từ S3 gateway. Dữ liệu thực chất được lưu trên virtuozzo storage để bảo đảm tính HA
- Name server: lưu thông tin metada của bucket bao gồm object name, ACL, dung lượng, vị trí, người sở hữu. Dữ liệu thực chất được lưu trên virtuozzo storage để bảo đảm tính HA
- S3 gateway: đóng vai trò là proxy giữa người dùng cuối và các máy chủ object. Nó nhận và xử lý các yêu cầu bằng giao thức Amazon S3 và sử dụng nginx Web server cho các kết nối từ bên ngoài. S3 gateway quản lý việc chứng thực tài khoản user và kiểm tra phân quyền ACL checks. Bản thân nó không sinh ra dữ liệu
- Block level: là virtuozzo storage
Với bài lab này ta triển khai cài đặt 3 role Object Server, Name Server và S3 gateway trên 3 hardware node đang chạy thuộc cụm Virtuozzo 6.0 với thông tin 3 node như sau
Server name: rs00360 - Storage IP: 172.16.10.24 - WAN IP: 103.199.9.24
Server name: rs00361 - Storage IP: 172.16.10.25 - WAN IP: 103.199.9.25
Server name: rs00362 - Storage IP: 172.16.10.26 - WAN IP: 103.199.9.26
Cài đặt Object Server
Bước 1 (thực hiện trên cả 3 node): add thông tin vào file /etc/hosts để phân giải hostname ra IP storage
172.16.10.24 rs00360 rs00360.dinodata.vn
172.16.10.25 rs00361 rs00361.dinodata.vn
172.16.10.26 rs00362 rs00362.dinodata.vn
Bước 2 (thực hiện trên cả 3 node): cài đặt gói pstorage-ostor
Code:
# yum install pstorage-ostor
Code:
ostor-ctl create -n <hostname> -r /var/lib/ostor/configuration -c "pstorage://<cluster_name>/<ostor_dir> 4 5"
<cluster_name> là tên cluster của virtuozzo 6.0
<ostor_dir> là thư mục chứa các tập tin của dịch vụ object storage
4 là số lượng node sẽ cài name server
5 là số lượng node sẽ cài storage object
Bước này hệ thống sẽ yêu cầu đặt mật khẩu
Trong bài này ta gõ lệnh sau:
Code:
ostor-ctl create -n rs00360 -r /var/lib/ostor/configuration -c "pstorage://minicloudt9/s3-t9 3 3"
Code:
# service ostor-cfgd start # chkconfig ostor-cfgd on
Code:
ostor-ctl init-storage -n <hostname> -s <cluster_mount_point>
Trong bài này ta gõ lệnh sau:
Code:
ostor-ctl init-storage -n rs00361 -s /pstorage/minicloudt9
Bước 6 (thực hiện trên các node sẽ chạy role object server): thêm các host vào cụm
Code:
# ostor-ctl add-host -r <cluster_mount_point>/<ostor_dir>
Code:
ostor-ctl add-host -r /pstorage/minicloudt9/s3-t9
Code:
# ostor-ctl add-s3gw -a <storage_IP>:9000
Code:
ostor-ctl add-s3gw -a 172.16.10.24:9000 ostor-ctl add-s3gw -a 172.16.10.25:9000 ostor-ctl add-s3gw -a 172.16.10.26:9000
Code:
# service ostor-agentd start # chkconfig ostor-agentd on
Code:
# ostor-ctl agent-status
Cài đặt Nginx
Code:
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm # rpm -ivh epel-release-6-8.noarch.rpm # yum install nginx -y
Cấu hình Nginx: Mở file /etc/nginx/conf.d/default.conf và nhập nội dung như bên dưới
Code:
upstream s3 {
server 172.16.10.24:9000; #S3 gateway 1 internal IP address
server 172.16.10.25:9000; #S3 gateway 2 internal IP address
server 172.16.10.26:9000; #S3 gateway 3 internal IP address
# Optional load balancing parameters (see http://nginx.org/en/docs/http/load_balancing.html)
}
server {
listen 80;
server_name s3.vinacis.com; #S3 endpoint. If you have DNS configured, replace the IP address with the corresponding hostname.
client_max_body_size 5g;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
location / {
fastcgi_pass_header Connection-close;
fastcgi_pass s3;
fastcgi_no_cache 1;
include fastcgi_params;
fastcgi_request_buffering off;
fastcgi_max_temp_file_size 0;
}
}
Bước 12: Khởi động dịch vụ Nginx
Code:
# service nginx start # chkconfig nginx on
Code:
# ostor-s3-admin create-user -e user@email.com
Bước 14: Khởi tạo Bucket mới
Hệ thống Virtuozo 6.0 không có công cụ để khởi tạo Bucket nên ta cần dùng công cụ của hãng thứ 3. Tải về và cài đặt công cụ CloudBerry Explorer for Amazon S3 tại địa chỉ: http://www.cloudberrylab.com/downloa...prod=cbes3free
Mở phần mềm CloudBerry Explorer for Amazon S3 --> File --> Add New Account --> S3 Compatible --> Điền các thông tin như sau
Display name: đặt tên cho kết nối. VD: vinacis
Service point: điền thông tin kết nối đến S3 Gateway. Trong trường hợp này là s3.vinacis.com:80Access key: điền access key lấy được ở bước 13
Secret key: điền Secret access key lấy được ở bước 13
Lưu ý bỏ dấu check ở hai tùy chọn "Use SSL" và "Use native multipath.."
Sau khi kết nối thì tạo Bucket mới
__________________
Đăng ký:
Nhận xét (Atom)

