Community Articles

Find and share helpful community-sourced technical articles.
Labels (1)
avatar
Expert Contributor

NiFi can be deployed to run as any non-root user. By default NiFi runs as user "nifi", but this can be modified.

For instructions, https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html then go to 'Admin Guide' then go to 'Bootstrap Properties’. In there it talks about 'run.as'

8,973 Views
Comments
avatar

If you installed NiFi as an Ambari service, there is a field controlling the runtime account for NiFi. It's 'nifi' by default.

avatar

Note that you would need to add this user to the list of sudoers first which the documentation hadn't mentioned. I ran into the same while building the ambari service. See https://issues.apache.org/jira/browse/NIFI-930

avatar
Expert Contributor

Good point. In particular, we should add the user to sudoers list in case their chosen processors access privilege ports or system resources.

avatar
Master Mentor

By Default NiFi will run as what ever user starts NiFi. NiFi can however be configured to start as a specific user by setting the run.as= property inside the bootstrap.conf file. *** Note that the user configured in this property will need to have sudo privileges to the java executable on linux based deployments. This could interfere with some processors that are dependent on the java process being owned by a particular user since it will be owned by root.

*** Setting the run.as user allows you to setup NiFi as a service that can be configured to start as part of the OS starting.