I would like to know there is methods to export user lists and passwords in synology NAS device
Asked
Active
Viewed 1.4k times
1 Answers
4
Local
See user Greenstream's answer in the Synology Forum:
- Download config backup file from the Synology
- Change file extension from .cfg to .gzip
- Unzip the file using 7-Zip or another utility that can extract from gzip archives
- Download and install DB Browser for SQL LIte from http://sqlitebrowser.org/
- Open the extracted ‘_Syno_ConfBkp.db’ file in DB Browser for SQL Lite
- From the top menu bar select File, then Export, then Export as csv
- In the export dialog select the table confbkp_user_tb
- In the options a. select column names in first line, Field separator character , b. Quote character " c. New line characters ‘Windows: CR+LF(\r\n)’
- Save the file to your desktop and open in Excel
LDAP
Based on ldap2csv.py and How to retrieve all the attributes of LDAP database to determine the available attributes, using 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)
The used ports can be found here.

user7217806
- 2,014
- 2
- 10
- 12
-
1Just to note - for newer DSM version, the downloaded file has a `.dss` extension, just rename to `.tar.xz` and extract as above. – Nick Andriopoulos Sep 30 '22 at 10:35