iRedMail批量使用者新增命令

2021-09-24 10:25:48 字數 1140 閱讀 8371

1、tools/create_mail_user_openldap.sh

語法:

# bash create_mail_user_openldap.sh domain user1 user2 user3 ... usern
domain:使用者郵件網域名稱,如:example.com

usern:使用者名稱

描述:

ldap_suffix:如cn=example,cn=com

bindpw:ldap root dn(cn=manager,dc=example,dc=com)對應的口令

quota:郵件賬戶空間大小,預設值100m

預設密碼與使用者相同

例子:

# cd iredmail-0.9.9/tools/

# bash create_mail_user_openldap.sh example.com user1 user2 user3

建立[email protected],[email protected],[email protected]三個使用者

2、tools/create_mail_user_openldap.py

語法:

# python create_mail_user_openldap.py my_users.csv
domain name, username, password, [common name], [quota_in_bytes], [groups]
使用該命令前,編輯該命令,修改basedn,為正確的base dn

命令輸出為ldif檔案,然後用如下命令匯入到ldap伺服器

# ldapadd -x -d cn=manager,dc=example,dc=com -w -f the_output_file.ldif
注意:

參考:

批量新增使用者

總結為4個步驟 1 需要新增的使用者,先存放到 使用者檔案 中 2 真實密碼儲存在shadow裡,etc passwd中為佔位符,現在將shadow中的密碼寫到passwd中,此時passwd中儲存的為真實密碼。3 密碼檔案 寫到passwd中 4 使用者配置檔案裡的密碼再寫回shadow中 編輯使...

批量新增使用者

newusers命令匯入使用者資訊檔案 格式 username userpassword uid gid usernote userhome shell 首先用vi建立 user.info檔案 可以在其寫入 brother01 1001 3 home brother01 bin bash broth...

批量新增域使用者

批量新增域使用者 下面是addusers.vbs的內容 它從同資料夾的users.txt讀取要新增的使用者及其密碼.set adsou getobject url ldap cn users,dc fkdl,dc local ldap cn users,dc fkdl,dc local url co...