2025/06/03

由於之前試的guacamole會一直當几斷線
今天找看看 meshcentral能不能錄影
有提供
不過要修改 config.json
路徑在 meshcentral-data/config/json

範例如下

{
  "$schema": "https://raw.githubusercontent.com/Ylianst/MeshCentral/master/meshcentral-config-schema.json",
  "settings": {
    "cert": "10.0.0.1",
    "WANonly": true,
    "_LANonly": true,
    "sessionKey": "MyReallySecretPassword1",
    "port": 443,
    "aliasPort": 443,
    "redirPort": 80,
    "redirAliasPort": 80
  },
  "domains": {
    "": {
      "title": "MyServer",
      "title2": "Servername",
      "minify": true,
      "newAccounts": true,
      "userNameIsEmail": true,
      "SessionRecording": {
        "_onlySelectedUsers": true,
        "_onlySelectedUserGroups": true,
        "onlySelectedDeviceGroups": true,
        "filepath": "/tmp/",
        "index": true,
        "protocols": [1, 2 ],
        "_maxRecordings": 100,
        "maxRecordingDays": 180,
        "maxRecordingSizeMegabytes": 1024
      }
    }
  },
  "_letsencrypt": {
    "email": "myemail@mydomain.com",
    "names": "myserver.mydomain.com",
    "skipChallengeVerification": true,
    "production": false
  }
}

這裡的config設好後 
就不用像之前啟動要再加上 --cert 10.0.0.1 了

node node_modules/meshcentral



2025/06/01

almalinux 10 几天前release

今天在proxmox (PVE) 上安裝時 用iso開几就出現 kernel panic



 








解決的方法就是cpu不要使用預設的 x86-64-v2-AES

也不要用  x86-64-v2

使用  x86-64-v3  或 x86-64-v4 就沒問題了

不過要注意的是 比較舊的host 可能無法支援這二個type 而無法 migrate










官方網站有提到
With RHEL 10, Red Hat will only support x86-64-v3 and higher

不過也有提到
AlmaLinux OS 10 has followed Red Hat’s decision to ship x86-64-v3 optimized binaries by default, but we will also provide an additional x86-64-v2 architecture, allowing users on that older hardware to continue to receive security updates for another 10 years.

所以如果一定要使用 x86-64-v2

就要下載另一個iso



2025/05/28

本來一直都是用ping 在 monitor AP的狀況的
這几天不知為什麼一直出現ping不到的情況
改用fping還是一樣
目前改用nping 來測 5246 port
看來正常了

/usr/bin/nping -c 1 --tcp -p 5246 10.0.1.4

2025/05/25

今天再度測試了一下PVE的firewall功能
發現只要打開cluster的firewall
預設就會載入很多firewall的rule 而且無法刪除
但在測試過程中發現竟然有 guest 原本提供服務的https 打不開了
而且原本使用 nmap做的一些測試也被擋了
最後決定在每台host直接下iptables 指令

#!/bin/bash

######## 以下是防護 host ##############
/usr/sbin/iptables -A INPUT -s 10.0.0.0/24 -j ACCEPT
/usr/sbin/iptables -A INPUT -p tcp -s 0/0 --dport 22 -j DROP
/usr/sbin/iptables -A INPUT -p tcp -s 0/0 --dport 8006 -j DROP

######## 以下是防護 guest  視需求新增  port #############
/usr/sbin/iptables -A FORWARD -s 10.0.0.0/24 -j ACCEPT
/usr/sbin/iptables -A FORWARD -p tcp -s 0/0 --dport 22 -j DROP
/usr/sbin/iptables -A FORWARD -p tcp -s 0/0 --dport 8006 -j DROP
/usr/sbin/iptables -A FORWARD -p tcp -s 0/0 --dport 8007 -j DROP

記得寫在 crontab  @reboot

2025/05/18

另一個集中管理主几的好物



安裝超級簡單

npm install meshcentral

官網的說明是啟動LAN 模式 只能在同網段 client 使用 multicast找到server

node node_modules/meshcentral



如果要跨網段 要使用以下指令啟動 加上server的 ip

node node_modules/meshcentral --cert 10.0.0.1

安裝完成請馬上登入 https://10.0.0.1
建立帳號 第一個建立的帳號就是系統的管理帳號
建完帳號後再以此帳號登入

接下來是處理被控端的 agent 程式 直接從web管理介面上即可下載















可選擇不同的OS 及版本
agent 程式放到client後可選擇只執行連線 或 安裝成service
連線成功後即會出現在如上圖的位置 可在管理介面上操控

2025/05/17

隨著docker使用的愈來愈多
更新管理這件事也變的重要
找到watchtower這個工具 還滿方便使用的

部署方式如下

docker run -d --restart=always \
--name watchtower \
-v /var/run/docker.sock:/var/run/docker.sock \
containrrr/watchtower \
--cleanup --remove-volumes \
--interval 86400

預設檢查時間是 86400 秒 可視需求調整


如果需要只email通知而不更新

docker run -d --restart=always \
  --name watchtower \
  -v /var/run/docker.sock:/var/run/docker.sock \
-e WATCHTOWER_NOTIFICATIONS=email \
-e WATCHTOWER_NOTIFICATION_EMAIL_FROM=from@example.com \
-e WATCHTOWER_NOTIFICATION_EMAIL_TO=to@example.com \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER=smtp.example.com \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PORT=587 \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_USER=from@example.com \
-e WATCHTOWER_NOTIFICATION_EMAIL_SERVER_PASSWORD=yourpassword \
  containrrr/watchtower \
  --monitor-only \
  --interval 86400 \



2025/05/16

裝好 guacamole 在管理介面几個要注意的地方

先建立連接

建立RDP連接時 如果一直無法連線 要調整安全模式
各個不同模式都試看看




















再來是螢幕錄影
路徑要跟 啟動docker 時 對應的路徑相同
名稱一定要設定 我這裡是跟連接設定相同名稱 方便識別
錄影檔只會有一個名稱為主的檔名 然後接續 .1 .2 .3 ...新增
要觀看必須要使用 guacenc 轉檔


















以下設定開啟檔案傳輸功能 就可以把檔案直接拖進瀏覽器內























在client產生一個共用資料夾 控制端把檔案拖進瀏覽器實際上是拖進這個共用資料夾內
這個資料夾是 guacd 這個docker的 /tmp
 











如果要從被控几下載檔案到控制几 要先把要下載的檔案放到這個資料夾內
之後在瀏覽器上 按 ctrl+alt+shift 打開側边欄 點選 shared Drive
就可以看到能下載的檔案 直接下載即可 
也可以在這個視窗上傳檔案到共用資料夾內























再來就是注意一定要設定時區
避免log對不上的問題

ctrl+alt+shift 可以叫出側邊功能面版 

2025/05/15

昨天有人介紹了一個可以管制登入並且螢幕錄影的軟体


今天試了一下
先安裝 本次都以docker 安裝
先pull四個image

網頁前端
docker pull guacamole/guacamole

主体程式
docker pull guacamole/guacd

資料庫
docker pull mysql

影像檔轉檔程式
docker pull litios/guacenc


在宿主几建立存放影像檔的資料夾 並提供給docker 掛載
mkdir /opt/screen_record
cd /opt
chmod -R 777 screen_record

啟動資料庫
docker run -d --name mysql -e MYSQL_ROOT_PASSWORD=guacamole mysql


生成並導入Guacamole初始化資料庫:

docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --mysql > initdb.sql
docker cp initdb.sql mysql:/
docker exec -it mysql bash
mysql -uroot -p
create database guac;
use guac;
source /initdb.sql;
exit
exit

啟動guacd 同時掛載影像檔目錄

docker run --name guacd -d -v /opt/screen_record:/recordings guacamole/guacd


啟動Guacamole Web應用,連結guacd和mysql:

docker run --name guacamole --link guacd:guacd --link mysql:mysql \
-e MYSQL_DATABASE=guac -e MYSQL_USER=root -e MYSQL_PASSWORD=guacamole \
-d -p 9090:8080 guacamole/guacamole


啟動guacenc 同時掛載影像檔目錄

docker run -v /opt/screen_record:/recordings -d -it --name guacenc litios/guacenc


瀏覽器訪問 http://你的IP:9090/guacamole,預設帳號密碼均為 guacadmin。


影像檔轉檔為m4v 指令
docker exec -it guacenc guacenc -s 1280x720 -r 20000000 -f /recordings/record_file_name


更新docker 開几重啟
docker update --restart always <容器ID或名稱>


下篇再補上操作介面說明

2025/05/12

因為ssl加解密的几制已經搞很久了還是有問題
所以找看看其他的解決方案
這几天試了一下 nginx 的 mirror 功能
記錄一下

在要執行 mirror 的 nginx 上設定如下

server {
    listen 443 ssl;
    server_name aaa.com.tw;


    ssl_certificate /etc/ssl/certs/server.cer;
    ssl_certificate_key /etc/ssl/certs/server.key;


    location / {
        proxy_pass http://primary_backend;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        mirror /mirror;

        mirror_request_body on;
    }

    location /mirror {
        internal;
        proxy_pass http://secondary_backend;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_read_timeout 1s;
        proxy_connect_timeout 1s;
    }
}

upstream primary_backend {
    server 10.0.0.1:80;
}

upstream secondary_backend {
    server 10.0.0.2:80;
}

10.0.0.1 是提供服務的server

10.0.0.2 接收 mirror過來的內容

10.0.0.1 10.0.0.2 二台都必須要起web server並listen 非加密的 80 port

10.0.0.2只需要啟動即可 不需要跟 10.0.0.1有相同的網頁內容
因為如果10.0.0.2沒有 web server  mirror過來的封包會被直接丟掉 

同時在 10.0.0.2上啟動 ids 軟体 如 snort, suricata 等 分析mirror過來的內容

10.0.0.1會把client的request解密後同時送到 10.0.0.1 10.0.0.2 

但不會 mirror server response 的內容


10.0.0.2 上的nginx access log 預設會記錄 10.0.0.1這個ip
如果要改成 request client的ip  nginx.conf 要新增以下內容

server {
    set_real_ip_from 10.0.0.1;
    real_ip_header X-Real-IP;



2025/05/06

昨天才注意到grafana最近的更新多了 Drilldown 這個功能
目前會用到的是log這個
之前要搜尋資料是到 Explore 這裡
現在直接到 Drilldown 就可以了
關鍵字預設會高亮
很方便

2025/05/05

最近試了一下 openobserve

直接下載執行即可

還滿方便的

速度也很快

功能很多

但在查詢上不是那麼方便

沒辦法直接使用關鍵字

執行複雜查詢的時候更麻煩

看之後會不會改進這個問題


https://openobserve.ai/

2025/04/25

近期用rclone備份到google時會一直出現如下的錯誤而不成功

 2025/04/23 09:00:26 ERROR : testdisk-7.1-WIP/icons/scalable/apps: error reading destination directory: couldn't list directory: googleapi: Error 403: Quota exceeded for quota metric 'Queries' and limit 'Queries per minute' of service 'drive.googleapis.com' for consumer 'project_number:20644'.

Details:

[

  {

    "@type": "type.googleapis.com/google.rpc.ErrorInfo",

    "domain": "googleapis.com",

    "metadata": {

      "consumer": "projects/20644",

      "quota_limit": "defaultPerMinutePerProject",

      "quota_limit_value": "420000",

      "quota_location": "global",

      "quota_metric": "drive.googleapis.com/default",

      "service": "drive.googleapis.com"

    },

    "reason": "RATE_LIMIT_EXCEEDED"

  },

  {

    "@type": "type.googleapis.com/google.rpc.Help",

    "links": [

      {

        "description": "Request a higher quota limit.",

        "url": "https://cloud.google.com/docs/quotas/help/request_increase"

      }

    ]

  }

]

, rateLimitExceeded


應該是google調整了備分api的相關設定

必須在 rclone加上以下的參數才行


--drive-chunk-size 256M --transfers=3 --tpslimit 3



2025/04/08

早上發現所有lxc的備分都沒有成功
出現如下的log

'/mnt/pve/nfs98_bck/dump/vzdump-lxc-123-2025_04_06-21_24_12.tar.zst'
INFO: tar: /mnt/pve/nfs98_bck/dump/vzdump-lxc-123-2025_04_06-21_24_12.tmp: Cannot open: Permission denied
INFO: tar: Error is not recoverable: exiting now

之前用qnap備分都沒問題 換成群灰就不行了
查了一下有二個解決方法

1.
把 tmpdir 指到 /tmp

vi /etc//etc/vzdump.conf

#tmpdir: DIR
tmpdir: /tmp


2.
改變群灰 共用資料夾 nfs權限
























2025/03/20

之前一直都是使用nc來傳資料到 syslog
但這几天發現做好的檔案都被砍了
反正eset現在不允許nc的執行
另外找了一個 sfk
之前有試過 但當時有不少bug
語法如下

sfk oload log.txt +udpsend 10.0.0.1:514


2025/03/15

最近又有人反應讀取mail的速度很慢
讀寫大量小檔的效能基本上很難提升
查到使用 noatime nodiratime 應該可以改善一些
原理讀取時不會再去update 檔案資訊 
這裡說的資訊如下 

stat test

檔案:test
  大小:87              區塊:8          IO 區塊:4096   一般檔案
裝置:801h/2049d        Inode:15466774    實際連結 (hardlink) :1
權限:(0664/-rw-rw-r--)    Uid:( 1000/      aa)  Gid:( 1000/      aa)
最近存取:2025-03-15 08:40:59.971496391 +0800
最近變更:2020-10-14 05:42:44.007905808 +0800
最近變更:2020-10-14 05:42:44.059906505 +0800
建立時間:-

把以上二個參數加到 /etc/fstab裡要作用的分區 再remount 即可

UUID=xxxx-xxxx-xxxx-xxxx /home xfs defaults,noatime,nodiratime 0 0


再觀察看看效果有多少

2025/03/12

最近要移除client端的軟体
包括 anydesk teamviewer winrar java 等等
一開始的想法是從eset protect定期下指令
於是設定了以下指令排程

"%ProgramFiles(x86)%\anydesk\anydesk.exe" --silent --remove
"%ProgramFiles%\TeamViewer\uninstall.exe" /S
"%ProgramFiles(x86)%\TeamViewer\uninstall.exe" /S
"%programfiles%\WinRAR\uninstall.exe" /s
"%programfiles(x86)%\WinRAR\uninstall.exe" /s

但發現不一定會有 uninstall.exe 這個檔案 所以不一定會成功
接著查到可以使用 powershell來處理 指令如下

powershell -Command "Get-WmiObject -Query 'SELECT * FROM Win32_Product WHERE Name LIKE ''Java%'' AND vendor LIKE ''oracle%''' | ForEach-Object { $_.Uninstall() }"

試了一下 powershell指令無法直接從eset protect直接下

為了執行時不跳出訊息
只能依照之前的做法 寫成uninstall.vbs   再加入client排程

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "powershell -Command ""Get-WmiObject -Query 'SELECT * FROM Win32_Product WHERE Name LIKE ''Java%'' AND vendor LIKE ''oracle%''' | ForEach-Object { $_.Uninstall() }""", 0, False


schtasks /create /tn "uninstall task" /tr "C:\ProgramData\uninstall.vbs" /sc weekly /d MON /st 09:00 /ru abc /f

之後如果需要再移除其他軟体 再更改 uninstall.vbs重新派送即可


20250329 補充

在某些狀況下 還是需要切換到系統管理員身分才有作用
必須再安裝 gsudo 
安裝後使用 gsudo 執行指令 才行

2025/02/14

今天在 almalinux 9 dnf update出現以下錯誤


Error:

Problem: package iptables-legacy-1.8.10-4.1.el9.x86_64 from @System requires (iptables-libs(x86-64) = 1.8.10-4.el9 or iptables-libs(x86-64) = 1.8.10-4.el9_4), but none of the providers can be installed

- cannot install both iptables-libs-1.8.10-11.el9_5.x86_64 from baseos and iptables-libs-1.8.10-4.el9_4.x86_64 from @System

- cannot install both iptables-libs-1.8.10-4.el9_4.x86_64 from baseos and iptables-libs-1.8.10-11.el9_5.x86_64 from baseos

- cannot install the best update candidate for package iptables-libs-1.8.10-4.el9_4.x86_64

- cannot install the best update candidate for package iptables-legacy-1.8.10-4.1.el9.x86_64

(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

本來想把iptables-legacy iptables-libs 都移除 但因為這台跑docker 如果移除會連docker一起移掉

查到官方 forum有人提供解法

dnf --assumeyes swap iptables-legacy iptables-nft


https://forums.almalinux.org/t/almalinux-9-yum-update-iptables-legacy-and-iptables-libs-conflict/3818/2

2025/02/06

要如何讓使用者能看影片但不被下載

首先把 mp4 分片

ffmpeg -i abc.mp4 -codec: copy -start_number 0 -hls_time 15 -hls_list_size 0 -f hls abc.m3u8

分片後把 abc.mp4 移出目錄


建立 index.html


<html>
<head>
  <link href="https://vjs.zencdn.net/8.21.1/video-js.css" rel="stylesheet" />

  <!-- If you'd like to support IE8 (for Video.js versions prior to v7) -->
  <!-- <script src="https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script> -->
</head>

<body>
  <video
    id="my-video"
    class="video-js"
    controls
    preload="auto"
    width="640"
    height="480"
    刪除以下一行
    poster="MY_VIDEO_POSTER.jpg"
    data-setup="{}"
  >
    <source src="MY_VIDEO.mp4" type="video/mp4" />
    <source src="MY_VIDEO.webm" type="video/webm" />
   刪除以上二行

    把第一步產生的所有分片檔放到 web server 的目錄 並依需求修改以下文字

    <source src='http://10.0.0.1/test/abc.m3u8' type="application/x-mpegURL">   
    
    <p class="vjs-no-js">
      To view this video please enable JavaScript, and consider upgrading to a
      web browser that
      <a href="https://videojs.com/html5-video-support/" target="_blank"
        >supports HTML5 video</a
      >
    </p>
  </video>

  <script src="https://vjs.zencdn.net/8.21.1/video.min.js"></script>
</body>
</html>


用browser打開即可觀看


2025/01/23

本次ZAP弱掃出現二個Medium


其實上次就有 不過這次要求連Medium都要處理
看來二個都是CSP的問題
之前改過一次版面會亂
這次再處理看看吧
要修改 /etc/apache2/apache2.conf 
加上以這這段

<IfModule mod_headers.c>

        Header set Content-Security-Policy "\
        default-src 'self';\
        img-src 'self' http://10.0.0.1 http://www.fcounter.net http://s11.flagcounter.com data:;\
        frame-src 'self' https://abc.com.tw https://www.youtube.com;\
        style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://cdnjs.cloudflare.com;\
        script-src 'self' https://cdn.jsdelivr.net https://code.jquery.com https://cdn.datatables.net 'unsafe-eval' 'unsafe-inline';\
        font-src 'self' https://cdnjs.cloudflare.com;\
        "

</IfModule>

內容需要依照自己的需求去修正
一個網頁一個網頁去看格式有沒亂掉 版面有沒正常
可以打開 browser 的開發人員工具
會顯示那些被CSP阻擋了
然後再補上去
需要補什麼問 https://www.perplexity.ai/ 比較快
把主控台上的訊息直接問就可以了

不難 但真的很花時間

2025/01/16

今天登入n8n看到通知





















想說之前升級都沒問題就沒先snapshot
結果升完後出現白畫面
只好倒回備分
再下一版看看吧

之後要升一定要先snapshot

2025/01/14

又到了弱掃的時間
昨天看報告
有二個問題

Vulnerability Detection Result
The remote SSH server supports the following weak KEX algorithm(s):
KEX algorithm | Reason
------------------------------------------------
diffie-hellman-group-exchange-sha1 | Using SHA-1


Vulnerability Detection Result
The remote SSH server supports the following weak client-to-server encryption algorithm(s):
aes128-cbc
aes256-cbc
The remote SSH server supports the following weak server-to-client encryption algorithm(s):
aes128-cbc
aes256-cbc


想說改一下 /etc/ssh/sshd_config就可以了

Ciphers aes128-ctr,aes192-ctr,aes256-ctr

KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512

沒想到重掃還是一樣

因為每次掃都要花很多時間
所以使用 nmap 特別針對ssh server來掃

nmap --script ssh2-enum-algos -sV -p 22   10.0.0.1


Starting Nmap 7.80 ( https://nmap.org ) at 2025-01-21 13:47 CST
Nmap scan report for 10.0.0.1
Host is up (0.00079s latency).

PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.0 (protocol 2.0)
| ssh2-enum-algos: 
|   kex_algorithms: (12)
|       curve25519-sha256
|       curve25519-sha256@libssh.org
|       ecdh-sha2-nistp256
|       ecdh-sha2-nistp384
|       ecdh-sha2-nistp521
|       diffie-hellman-group-exchange-sha256
|       diffie-hellman-group14-sha256
|       diffie-hellman-group16-sha512
|       diffie-hellman-group18-sha512
|       diffie-hellman-group-exchange-sha1
|       diffie-hellman-group14-sha1
|       kex-strict-s-v00@openssh.com
|   server_host_key_algorithms: (5)
|       rsa-sha2-512
|       rsa-sha2-256
|       ssh-rsa
|       ecdsa-sha2-nistp256
|       ssh-ed25519
|   encryption_algorithms: (7)
|       aes256-gcm@openssh.com
|       chacha20-poly1305@openssh.com
|       aes256-ctr
|       aes256-cbc
|       aes128-gcm@openssh.com
|       aes128-ctr
|       aes128-cbc
|   mac_algorithms: (8)
|       hmac-sha2-256-etm@openssh.com
|       hmac-sha1-etm@openssh.com
|       umac-128-etm@openssh.com
|       hmac-sha2-512-etm@openssh.com
|       hmac-sha2-256
|       hmac-sha1
|       umac-128@openssh.com
|       hmac-sha2-512
|   compression_algorithms: (2)
|       none
|_      zlib@openssh.com

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 0.29 seconds

果然還是沒用
找了半天資料 才找到解決方法

先處理 
aes128-cbc
aes256-cbc

先建一個文件內容如下

vi /etc/crypto-policies/policies/modules/DISABLE-CBC.pmod

cipher = -AES-128-CBC -AES-256-CBC
ssh_cipher = -AES-128-CBC -AES-256-CBC


更新加密策略

update-crypto-policies --set DEFAULT:DISABLE-CBC


再來處理

diffie-hellman-group-exchange-sha1


vi /etc/crypto-policies/back-ends/opensshserver.config

刪除以下文字

,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1



重啟 sshd

systemctl restart sshd


再跑一次 
nmap --script ssh2-enum-algos -sV -p 22   10.0.0.1

Starting Nmap 7.80 ( https://nmap.org ) at 2025-01-21 13:59 CST
Nmap scan report for 10.0.0.1
Host is up (0.00077s latency).

PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 8.0 (protocol 2.0)
| ssh2-enum-algos: 
|   kex_algorithms: (10)
|       curve25519-sha256
|       curve25519-sha256@libssh.org
|       ecdh-sha2-nistp256
|       ecdh-sha2-nistp384
|       ecdh-sha2-nistp521
|       diffie-hellman-group-exchange-sha256
|       diffie-hellman-group14-sha256
|       diffie-hellman-group16-sha512
|       diffie-hellman-group18-sha512
|       kex-strict-s-v00@openssh.com
|   server_host_key_algorithms: (5)
|       rsa-sha2-512
|       rsa-sha2-256
|       ssh-rsa
|       ecdsa-sha2-nistp256
|       ssh-ed25519
|   encryption_algorithms: (5)
|       aes256-gcm@openssh.com
|       chacha20-poly1305@openssh.com
|       aes256-ctr
|       aes128-gcm@openssh.com
|       aes128-ctr
|   mac_algorithms: (8)
|       hmac-sha2-256-etm@openssh.com
|       hmac-sha1-etm@openssh.com
|       umac-128-etm@openssh.com
|       hmac-sha2-512-etm@openssh.com
|       hmac-sha2-256
|       hmac-sha1
|       umac-128@openssh.com
|       hmac-sha2-512
|   compression_algorithms: (2)
|       none
|_      zlib@openssh.com

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 0.33 seconds


已經全部修正
再重掃一次也沒問題了

2025/01/13

從昨天晚上開始 suricata的cpu就會一直跑到98以上而且降不下來
看了一下 log 出現大量的 truncated 

Jan 13 04:30:33 suricata suricata[77297]: [1:2200003:2] SURICATA IPv4 truncated packet [Classification: Gen
eric Protocol Command Decode] [Priority: 3] [**] [Raw pkt: C0 C5 20 6B A9 DA 00 60 E0 8A 76 E3 08 00 45 00 
0A 8C 8F C5 00 0]

Jan 13 10:44:03 suricata suricata[78]: [1:2200013:2] SURICATA IPv6 truncated packet [Classification: Generic Protocol Command Decode] [Priority: 3] [**] [Raw pkt: C0 C5 20 6B A9 DA 00 60 E0 8A 76 E3 86 DD 60 81 56 A3 10 DC 06 3]

先把這二個偵測暫停 

/etc/suricata/rules/decoder-events.rules

再觀察看看

2025/01/10

在PVE中撈出所有guest的 cpu使用率並在超過上限值時發出告警


#!/bin/bash

pvesh get /cluster/resources|awk '{print $2" "$33" "$8}'|grep -E "lxc|qemu"|sed 's/....$//' > /tmp/all_guest_cpu

cat /tmp/all_guest_cpu | awk  '$3 > 80 {print $0}' > /tmp/guest_cpu_high

if [ -s /tmp/guest_cpu_high ]; then

        sed -i '1i network guest cpu high' /tmp/guest_cpu_high
        sed -i '2i ==========' /tmp/guest_cpu_high
        cp /tmp/guest_cpu_high /tmp/guest_cpu_high_network
        /usr/bin/lftp ftp://user:pwd@10.0.0.1 -e "put /tmp/guest_cpu_high_network; bye"
        mutt -s guest_cpu_high user@abc.com < /tmp/guest_cpu_high

fi

2025/01/03

今天使用 tabby ssh 到almalinux 8 後 vi打中文時出現以下的狀況

中�~V~G試�~\~K�~\~K

但 cat 正常

找了資料 說要改 tabby config

appearance:
  - Character encoding: utf-8

改了還是沒用

最後解決的方法是先在 almalinux 8 安裝vim

dnf install vim

在home目錄建立 .vimrc 內容如下

set encoding=utf-8
set fileencoding=utf-8

設定 alias

echo "alias vi='vim'" >> ~/.bashrc

醬就正常了