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

Is it possible to run apahce nifi as different user? I have configured different user on bootstrap.conf


I tried simple use case.

GetFile processor will pick file PutFile will put those files.

in PutFile configuration I have given a non-existent path, I am expecting NiFi to create path structure with user configured in bootstrap.conf

NiFi is creating directory structure with root user.

While checking status of NiFi it says:

-bash-4.1# sh status

Java home: /storm/prady/jdk1.8.0_111 NiFi home: /storm/prady/nifi-1.1.1

Bootstrap Config File: /storm/prady/nifi-1.1.1/conf/bootstrap.conf

Error: Could not find or load main class org.apache.nifi.bootstrap.RunNiFi


Master Guru
@Pradhuman Gupta

In order to switch NiFi to run as a different user then it was previously running as, it is important to change ownership of all NiFi's files to the new user as well.

Master Guru

@Pradhuman Gupta

If you shutdown NiFi, change ownership of all the directories and files to your new user, then login or become the the new user you want NiFi running as, and finally as that user start NiFi. Does it start?




@Matt Clarke

Thanks Matt,

I tried this but its not working.

Above use case is not working. I am expecting PutFile to create new directory with configured user (configured user in bootstrap.conf). But again and again its creating file/folder using logged in user


If you list processes with ps, does it show NiFi running as your original user or the one configured in bootstrap.conf?


Its running as original user. that's problem


what do you see if your run (using the same user you want to invoke the start script with)

sudo -u USER_NIFI_SHOULD_RUN_AS whoami