Let's say you have logged onto RabbitMQ as the rabbitmq user.
~]# whoami rabbitmq
But when you issue the rabbitmq-plugins command, "Only root or rabbitmq can run rabbitmq-plugins" is being returned.
]# rabbitmq-plugins list Only root or rabbitmq can run rabbitmq-plugins
This is a bug with the /usr/sbin/rabbitm-plugins file when running RabbitMQ on a container platform such as Docker or Red Hat OpenShift. In this scenario, using the full absolute path to the rabbitmq-plugins command should allow you to use the rabbitmq-plugins command.