如果受nagios偵測的主機沒開ping/icmp的話
如何偵測Host Status
define host{
host_name bpm
check_command check_tcp!443
....
....
....
如果受nagios偵測的主機沒開ping/icmp的話
如何偵測Host Status
define host{
host_name bpm
check_command check_tcp!443
....
....
....
如果安裝windows 10 的日文輸入法,出現以下錯誤訊息
japanese ime is not ready yet
please check status from language setting
解決方法
1. 安裝第三方輸入法
如google日文輸入法
2. 已系統管理員執行以下powershell指令
DISM.exe /Online /Add-Capability /CapabilityName:Language.Basic~~~ja-JP~0.0.1.0
https://go.dev/dl/ 找到適合的golang 版本
目前最新版本為 go1.22.1.linux-amd64.tar.gz
# wget https://go.dev/dl/go1.22.1.linux-amd64.tar.gz
# tar -C /usr/local -xzf go1.22.1.linux-amd64.tar.gz
# export PATH=$PATH:/usr/local/go/bin
加入 /etc/bash.bashrc ,下次登入後,自動載入
如果出現以下錯誤
go: cannot find GOROOT directory:
# export GOROOT=/usr/local/go 並加入 /etc/bash.bashrc
測試
# go version
go version go1.22.1 linux/amd64 <= 出現以下資訊,表示安裝成功
Gophish 是一套免費的 Open-Source Phishing Framework 開源網路釣魚框架
https://getgophish.com/
安裝好的作業系統,並更新套件
apt -y update
apt -y upgrade
安裝 unzip
apt -y install unzip
下載程式,目前最新版還是 2022 年的 v0.12.1
wget https://github.com/gophish/gophish/releases/download/v0.12.1/gophish-v0.12.1-linux-64bit.zip
解壓縮
mkdir gophish
unzip gophish-v0.12.1-linux-64bit.zip -d ./gophish
修改設定檔,管理介面預設只listen localhost
cd gophish
找到
"admin_server": {
"listen_url": "127.0.0.1:3333",
改成
"admin_server": {
"listen_url": "0.0.0.0:3333",
存檔離開
啟動gophish
chmod u+x gophish
./gophish
可以在執行的log中找到預設的admin 密碼
如
time="2024-01-30T21:09:45-05:00" level=info msg="Please login with the username admin and the password xxxxxxxx"
測試瀏覽器登入
登入成功後,會要求變更密碼,變更完成後即可進入管理介面
power shell 可以列出exchange online 某個通訊群組包含哪些成員
但無法直接從個人帳號反推屬於哪些通訊群組
需透過迴圈來實現
Connect-ExchangeOnline
$userMailbox = "個人信箱"
Get-DistributionGroup | ForEach-Object {
$group = $_
$groupMembers = Get-DistributionGroupMember -Identity $group.Identity -ResultSize Unlimited
$userInGroup = $groupMembers | Where-Object { $_.PrimarySmtpAddress -eq $userMailbox }
if ($userInGroup) {
Write-Host "$userMailbox -> $($group.DisplayName) ($($group.PrimarySmtpAddress))"
}
}
主機 > 管理 > 系統 > 進階選項 > Security.PasswordQualityControl > 動作 > 編輯選項
預設值為 retry=3 min=disabled,disabled,disabled,7,7
如果要改成簡單一點的密碼,可以先把上述值顯改成 retry=3 min=1,1,1,1,1
修改完密碼後再改回預設值
phpmailer 指定收件者為 user1@example.com 設定如下
$mail->AddAddress("user1@example.com");
如果要加第二筆收件者,僅需重複 $mail->AddAddress(); 即可
如:
$mail->AddAddress("user1@example.com");
$mail->AddAddress("user2@example.com");
同時還可以加入副本收件者
$mail->AddCC("user3@example.com");
$mail->AddCC("user4@example.com");
加入密件副本收件者
$mail->AddBCC("user5@example.com");
$mail->AddBCC("user6@example.com");
安裝完的 truenas scale 網路預設使用 dhcp 連線
如果要改成固定ip
除了先知道 dhcp ip 後,再透過 web ui 連線修改
也可以透過 console 調整
1) Configure network interfaces
2) Configure network settings
3) Configure static routes
4) Change local administrator password
5) Reset configuration to defaults
6) Open TrueNAS CLI Shell
7) Open Linux Shell
8) Reboot
9) Shutdown
選擇: 1) Configure network interfaces
選擇網卡 > 停用 ipv4_dhcp
找了好久,找不到 static ip 的關鍵字在哪邊,原來是新增 aliases
新增 aliases: 輸入 192.168.0.100/24
存檔之後按
a (apply) > p (presist) > q (quit)
$ vi test.sh
#!/bin/sh
cat > pipe.out
執行
$ echo "Hello World" | ./test.sh
$ cat pipe.out
Hello World
使用stat 指定列出檔案的 ctime , mtime , atime
root@lab-101:/workdir# stat this-is-a-file
File: this-is-a-file
Size: 505987 Blocks: 992 IO Block: 4096 regular file
Device: 801h/2049d Inode: 1048579 Links: 1
Access: (0646/-rw-r--rw-) Uid: ( 106/ tftp) Gid: ( 113/ tftp)
Access: 2023-11-20 14:39:11.722228112 +0800
Modify: 2023-11-20 14:38:52.570334312 +0800
Change: 2023-11-20 14:38:52.570334312 +0800
Birth: 2023-11-20 14:30:57.628959474 +0800
安裝 tftp server
apt install tftpd-hpa
安裝 tftp client
apt install tftp
編輯設定檔
vi /etc/default/tftpd-hpa
# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/srv/tftp"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--secure"
調整tftp 資料匣權限
chown -R tftp:tftp /srv/tftp
測試下載
tftp 192.1681.1.1
tftp> get 234.txt
Received 5 bytes in 0.0 seconds
測試上傳
tftp> put 123.txt
Error code 1: File not found
解決方式:
touch /srv/tftp/123.txt ; chown tftp:tftp /srv/tftp/123.txt
再次測試上傳
tftp> put 123.txt
Error code 2: File must have global write permissions
解決方式:
chmod o+w /srv/tftp/123.txt
再次測試上傳
tftp> put 123.txt
Sent 9 bytes in 0.0 seconds
成功,但納悶 123.txt 的owner 和 tftp 的身分都一樣,為什麼沒權限上傳,沒時間研究,先醬
redmine top-menu 預設字型很小很小,如果要調整上方字型的大小
cd ./redmine/public/stylesheets
vi application.css
#top-menu {background: #3E5B76; color: #fff; height:1.8em; font-size: 0.8em; padding: 2px 10px 0px 12px;}
將紅字部分改成 1.2 我覺得就很合適了
測試環境: docker + apache base
root@hellowordl:/home/nextcloud# docker exec --user www-data <CONTAINER ID> php occ config:system:set twofactor_enforced false
System config value twofactor_enforced => false set to empty string
若出現以下訊息
Operation Type
Update
File Type
Backup Image
Status
Operation Failed
Error
Copy: Version too old, downgrade prevented.
請將下載下來的zip 解壓縮,僅上傳 *.wsi 即可
測試環境
docker: Base version - apache + mariadb
root@helloworld:~# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
846abceb2e61 nextcloud "/entrypoint.sh apac…" 2 days ago Up 2 days 0.0.0.0:8080->80/tcp nextcloud-app-1
ab2fb11739b8 mariadb:10.6 "docker-entrypoint.s…" 2 days ago Up 2 days 3306/tcp nextcloud-db-1
root@helloworld:~# docker exec -it nextcloud-app-1 bash
root@846abceb2e61:/var/www/html# runuser -u www-data php /var/www/html/occ user:resetpassword admin
Enter a new password:
Confirm the new password:
Successfully reset password for admin
root@846abceb2e61:/var/www/html#
用AD帳號 登入windows 時,如果出現以下錯誤訊息
此工作站和主要網域間的信任關係失敗
解決方式:
使用本機帳號登入
確認系統時間與AD DC 之間是否有時間差
時間調整一致,登出再用AD 帳號登入測試是否成功
手動更新時間,出現以下錯誤訊息
root@lab:~# timedatectl set-time 11:55:12
Failed to set time: Automatic time synchronization is enabled
關閉 ntp 自動校時
root@lab:~# timedatectl set-ntp no
重新手動更新
root@lab:~# timedatectl set-time '2023-09-19 11:58:30'
root@lab:~# date
Tue 19 Sep 2023 11:58:31 AM CST
找到 httpd-ssl.conf
每個版本路徑可能不大一樣,要自行找一下
找到以下關鍵字
SSLProtocol all -SSLv3
調整成
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
存檔,重啟 apache
可用 nmap 工具測試
nmap --script ssl-enum-ciphers -p 443 example-server
報告內容
Summary
The remote SSH server is configured to allow / support weak host
key algorithm(s).
Detection Result
The remote SSH server supports the following weak host key algorithm(s):
如果你習慣的預設瀏覽器是 google chrome
但每次透過outlook 開啟連結時,系統卻預設幫你用 microsoft edge 開啟
(建立新的檔案系統)
zfs create testpool/data1
大約就在今年8/10 左右
更新 adobe pdf reader 之後
透過填寫和簽署新增輸入文字並存檔後
再次打開文件,文字就變成框框+叉叉
exchange online 的通訊群組清單,類似 postfix, sendmail 的 aliases
寄信時不用一個一個增加收件者
該收件者帳號收到信時,可以自動轉寄給特定或多位使用者
常用於部門群組信箱,或專案用信箱
假設你要寄信給 it部門
其成員有: bill , john , peter , mary
除了收件者欄位一個一個慢慢選
還可以設定一個部門信箱,如 it@xxx.com.tw
在cmd 下指令
net user loginname /domain
即可顯示密碼到期日
設定 > 時間與語言
登入後點擊右上角帳號圖示 > Configuration > Backup
Fortigate 的 SPAN (Switch Port Analyzer) 也就是常聽到的 port mirror
指令:
# docker-compose rm -s -v service_name
或是參數合在一起也可以
# docker-compose rm -sv service_name
Options:
-f, --force Don't ask to confirm removal
-s, --stop Stop the containers, if required, before removing
-v, --volumes Remove any anonymous volumes attached to containers
舉例
docker-compose.yml 內容
web_lab:
container_name: container_web_lab
image: myweb:5.5.5
depends_on:
- mysqldb
root@srv:/helloworld# docker-compose rm -sv web_lab
[+] Running 1/1
⠿ Container container_web_lab Stopped 1.5s
? Going to remove container_web_lab Yes
[+] Running 1/1
⠿ Container container_web_lab Removed 0.6s
root@srv:/helloworld# docker-compose up -d web_lab
[+] Running 2/2
⠿ Container web_db Running 0.0s
⠿ Container container_web_lab Started