Why does X-Pack require root permissions for installation?

I'm currently setting up an elasticsearch cluster for a client, who prefers to not have me run anything as root.
This works quite ok with the tarball release, but I get stuck at installing x-pack.

It looks like the x-pack installation just uses root privileges to set ownership on some of its directories.
Is this absolutely necessary? Could I just copy over an installation directory from somewhere else, that already has x-pack installed?

[...]

Continue with installation? [y/N]y
Exception in thread "main" java.nio.file.FileSystemException: /opt/elasticsearch-5.0.0/config/x-pack: Operation not permitted
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileAttributeViews$Posix.setOwners(UnixFileAttributeViews.java:252)
at sun.nio.fs.UnixFileAttributeViews$Posix.setGroup(UnixFileAttributeViews.java:291)
at org.elasticsearch.plugins.InstallPluginCommand.setOwnerGroup(InstallPluginCommand.java:582)
at org.elasticsearch.plugins.InstallPluginCommand.installConfig(InstallPluginCommand.java:555)
at org.elasticsearch.plugins.InstallPluginCommand.install(InstallPluginCommand.java:490)
at org.elasticsearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:207)
at org.elasticsearch.plugins.InstallPluginCommand.execute(InstallPluginCommand.java:190)
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:96)
at org.elasticsearch.cli.MultiCommand.execute(MultiCommand.java:69)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:96)
at org.elasticsearch.cli.Command.main(Command.java:62)
at org.elasticsearch.plugins.PluginCli.main(PluginCli.java:42)

Hey,

there is no need to be root. You can install Elasticsearch as any user. Just make sure that the user you are installing x-pack is, is the same as the one you installed elasticsearch with or that this user is able to write into the Elasticsearch directory.

--Alex

I just started from scratch and now it works. I must have done something wrong with the initial unpack/move. Feeling pretty stupid. :slight_smile:

Thanks!