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)

nextcloud 綁定ldap, 突然無法登入

nextcloud 綁定公司兩台AD , 一台台北, 一台蘇州 , 兩台不同網域

但是今天發生蘇州網域伺服器停機(停電超過4小時), 居然造成nextcloud所有人員無法登入的情況

查了一下解法, 可以先暫時停用蘇州的ldap連線,

sudo -u www-data php occ ldap:set-config s02 ldapConfigurationActive 0

以下是ldap相關指令, 可以先查詢設定檔案名稱之後, 如s01 , s02 , 再停用連線

ldap
 ldap:check-user               checks whether a user exists on LDAP.
 ldap:create-empty-config      creates an empty LDAP configuration
 ldap:delete-config            deletes an existing LDAP configuration
 ldap:search                   executes a user or group search
 ldap:set-config               modifies an LDAP configuration
 ldap:show-config              shows the LDAP configuration
 ldap:show-remnants            shows which users are not available on
                               LDAP anymore, but have remnants in
                               Nextcloud.
 ldap:test-config              tests an LDAP configuration

Linux 安裝字型

以前一直覺得字型不重要, 直到改用免費office之後, 才發現非常重要啊

因此沒事要收集必要的字型檔案(ttf, ttc) , github 上面也有一些可以收集的.

收集完畢, 在linux上建立自己的font目錄

mkdir ~/.fonts
然後複製ttf, ttc到 .font目錄
最後執行
fc-cache -fv

重開機應該就可以了

除此之外, 還要安裝相關字型套件

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