Support Questions
Find answers, ask questions, and share your expertise

How to configure Ranger Usersync to sync users from a file


Expert Contributor

Set the following properties in usersync :

usergroupSync.source.impl.class = org.apache.ranger.unixusersync.process.FileSourceUserGroupBuilder

usergroupSync.filesource.file =C:\\tmp\userSource1.json

usergroupSync.filesource.text.delimiter = , Example file: Multiple Users


"user1001": [











"user2001": [






Another approach:

Create a text file containing user/group details in the following format:

        - one line for each user

        - each line consists of multiple fields, separated by a comma

        - the first field is the username and every field after that is a group name the user belongs to

        - example line: user1,group1, group2,group3

  Load the user/group information in the text file, say at /home/user/ranger-users.txt, with the following command line:

  java -cp "/usr/hdp/current/ranger-usersync/dist/unixusersync-*:/etc/ranger/usersync/conf" com.xasecure.unixusersync.process.FileSourceUserGroupBuilder /home/user/ranger-users.txt
Updated for Ranger 0.50
java -Dlogdir=/var/log/ranger/usersync -cp "/usr/hdp/current/ranger-usersync/dist/*:/usr/hdp/current/ranger-usersync/lib/*:/usr/hdp/current/ranger-usersync/conf" org.apache.ranger.unixusersync.process.FileSourceUserGroupBuilder /tmp/UserGroupSyncFile.txt

Expert Contributor

Thanks for creating the wiki for this

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.