postfix 關於rate limit設定

一些基本限制相關連線的基本設定

##
## 效能調教, 視情況修改
##
#default_process_limit = 150
#qmgr_message_active_limit = 40000
#qmgr_message_recipient_limit = 40000
#default_destination_concurrency_limit=100
#default_destination_recipient_limit=100
#default_process_limit=200
#smtp_mx_session_limit=100
#smtp_destination_concurrency_limit=100
#maximal_backoff_time = 1000s
#minimal_backoff_time = 300s

##
## 阻擋惡意連線
## 
smtpd_error_sleep_time = 1s
smtpd_soft_error_limit = 10
smtpd_hard_error_limit = 20

##
## 用戶端每60秒,最多連線20次, 且同時只能10個連線
##
anvil_rate_time_unit=60s
smtpd_client_connection_rate_limit=20
smtpd_client_connection_count_limit=10

,

ssh 用戶端不支援舊版加密解法

新的ssh 用戶端已經不支援舊版的加密方式, 因此若伺服器提供的sshd 加密過舊, 則必須手動調整,讓ssh 用戶端強制使用舊版方式連線.

做法就是先確認伺服器提供的加密法

# ssh -l root 192.168.1.1
Unable to negotiate with 192.168.1.1 port 22: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

然後請視情況(錯誤訊息), 更改演算法與支援的key

ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -oHostKeyAlgorithms=+ssh-dss -l root  x.x.x.x 

若連線還是失敗, 出現以下錯誤

ssh_dispatch_run_fatal: Connection to 192.168.1.1 port 22: error in libcrypto

用戶端嘗試執行以下指令

update-crypto-policies --set LEGACY

postfix ldap測試/查詢帳號是否存在

postfix 很常見搭配微軟的AD , AD的設定檔長這樣, 檔案名稱為 xxx.cf

server_host = <AD server IP>
search_base = ou=xx,dc=yyy,dc=com
version = 3
query_filter = (&(objectclass=*)(mail=%s))
result_attribute = samaccountname  #Account from DC
result_format = %s/Maildir/
bind = yes
bind_dn = cn=zzz,cn=Users,dc=yyy,dc=com
bind_pw = password

配合以下指令,可以用來查詢email對應的帳號是否正確

postmap -q  abc@yyy.com ldap:/directory/xxx.cf

這樣就可以測試帳號是否存在了

8/13起 github 專案commit要改用token

github 公告 2021/8/13起, 強制改用token的方式, 之前使用密碼的方式不能再用

"Beginning August 13, 2021, we will no longer accept account passwords when authenticating Git operations on GitHub.com."

所以要到個人github上, 生成token, 然後當作密碼使用

https://github.com/settings/tokens

  1. 先產生 token , 將token copy 起來

2. 用戶端輸入帳號,與密碼(此時不要輸入真的密碼, 請輸入token)

1 ... 3 4 5 6 7 ... 13