如何在synology NAS中导出用户列表和密码

问题描述 投票:0回答:1

我想知道Synology NAS设备中存在导出用户列表和密码的方法

synology
1个回答
0
投票

本地

请参阅Synology Forum中Greenstream用户的答案:

  1. 从Synology下载配置备份文件
  2. 将文件扩展名从.cfg更改为.gzip
  3. 使用7-Zip或其他可以从gzip存档中提取的实用程序解压缩文件
  4. [从http://sqlitebrowser.org/下载并安装用于SQL LIte的DB浏览器
  5. 在数据库浏览器中打开用于SQL Lite的提取的__Syno_ConfBkp.db文件
  6. 从顶部菜单栏中选择文件,然后导出,然后导出为csv
  7. 在导出对话框中,选择表confbkp_user_tb
  8. 在选项中一种。在第一行中选择列名称,字段分隔符,b。引用字符“C。新行字符“ Windows:CR + LF(\ r \ n)”
  9. 将文件保存到桌面并在Excel中打开

LDAP

基于ldap2csv.pyHow to retrieve all the attributes of LDAP database,使用python-ldap确定可用属性:

#!/usr/bin/python
import ldap

host = 'ldap://[ip]:389'          # [ip]: The ip/name of the NAS, using the default port
dn = 'uid=[uid],cn=[cn],dc=[dc]'  # LDAP Server Settings: Authentication Information / Bind DN
pw = '[password]'                 # LDAP Server Settings: Password
base_dn = 'dc=[dc]'               # LDAP Server Settings: Authentication Information / Base DN

filter = '(uid=*)'  # Get all users
attrs = ['cn', 'uid', 'uidNumber', 'gidNumber', 'homeDirectory', 'userPassword', 'loginShell', 'gecos', 'description']

con = ldap.initialize(host)
con.simple_bind_s(dn, pw)
res = con.search_s(base_dn, ldap.SCOPE_SUBTREE, filter, attrs)
con.unbind()

print(res)

可以找到使用的端口here

© www.soinside.com 2019 - 2024. All rights reserved.