/etc/systemd/logind.conf の設定
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
この三つの設定を、
HandlePowerKey=ignore
HandleSuspendKey=ignore
HandleHibernateKey=ignore
とすること。
参考:https://mseeeen.msen.jp/how-to-avoid-sleep-on-pc-closing-with-centos-7/