Elasticsearch 7.17.6 can't be started as root

Hello, I'm using RHEL 7.6 Maipo and I'm trying to start the elasticsearch service in a single node instance as root, but I'm receiving this error after i try to start the service using ./elasticsearch -d
Error meesage:
java.lang.RuntimeException: can not run elasticsearch as root
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:107)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:183)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:169)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:160)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
at org.elasticsearch.cli.Command.main(Command.java:77)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:125)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)

Welcome!

You can not run as root.

Hello, David

Doing a research, I've found that Elastic Search can't be run as root. But maybe using a different approach would I be able to run it as root? In the machine I'm working on I can't create a new user only for run Elasticsearch even I can't create a different user than root.

Also, I've tried this '-Des.insecure.allow.root=true' but it's not working for me. Thanks for your help and I hope someone has a way to get the service running as root.

As outlined in the documentation you must never run Elasticsearch as root and Elasticsearch will as you have noticed prevent this.

Thank you Christian, but I'm trying to achieve this because I need to start the Elasticsearch service in a cloud instance where I'm not able to create/use a different user than root. I've read the doc you linked but just curious if there is a different way to get the root user running Elasticsearch service.
Thank you

Can you try installing from a deb or rpm package?

If you have root access I do not see how you could be prevented from creating a new user. Where exactly are you installing?