How to lxc-attach

I want to run commands in a container from a specific user. What am I doing…
sudo -u lxcuser lxc-attach -n host-0000 ls /home/lxctl/
sudo -u lxcuser bash -c “lxc-attach -n host-0000 ls /home/lxctl/”

how to do it right?

lxc-attach -n <container name> -- <command>

You can use the --help flag on most Unix commands to get instructions for usage, in this case it would have shown you:

lxc-attach --help
Usage: lxc-attach --name=NAME [-- COMMAND]

Execute the specified COMMAND - enter the container NAME