I need to ability to halt an aws EC2 server as user. I found https://www.cyberciti.biz/tips/howto-linux-allow-users-to-shutdown-server.html but due to the fact that I need this feature on an aws EC2 instance, I don't have a static hostname, so I tried:
ubuntu ALL=(ALL:ALL) ALL=/sbin/halt /sbin/reboot
but that got me:
>>> /etc/sudoers: syntax error near line 21 <<< What now? Options are: (e)dit sudoers file again e(x)it without saving changes to sudoers file (Q)uit and save changes to sudoers file (DANGER!)
how can I solve this correctly?