Create a `systemd` service and add this to the `[Service]` section: `[Service]` `Exec=gnome-session-quit --logout --no-prompt` [How to start a systemd service after user login and stop it before user logout][1] [How create a service in linux that can handle queries?][2] [ gnome-session-quit][3] *Or you can also try the following, which probably won't work:*. > @reboot sleep 60 && gnome-session-quit --logout --no-prompt > This might help to wait 60 sec, if the session isn't fully loaded when the system starts, and the logout command might not work immediately for that reason. [1]: https://superuser.com/q/1037466/1780440 [2]: https://unix.stackexchange.com/q/603820/342980 [3]: https://manpages.ubuntu.com/manpages/focal/en/man1/gnome-session-quit.1.html