Sorry for the confusion. Above error is what I intentionally made by writing garbage in
/etc/tor/torrc, so no worries.
sudo tor V.S.
sudo -u debian-tor tor
There is a torrc option
User which is in the torrc:
user@host:~$ cat /usr/share/tor/tor-service-defaults-torrc | grep User
User option is set, we can simply use
sudo tor and tor will be run as
User option is set, when we do
sudo -u debian-tor tor, tor will fail to start and complain:
Mar 15 14:56:22.015 [warn] Error setting groups to gid 115: "Operation not permitted".
Mar 15 14:56:22.015 [warn] Tor is already running as debian-tor. You do not need the "User" option if you are already running as the user you want to be. (If you did not set the User option in your torrc, check whether it was specified on the command line by a startup script.)
Mar 15 14:56:22.015 [warn] Failed to parse/validate config: Problem with User value. See logs for details.
Mar 15 14:56:22.015 [err] Reading config failed--see warnings above.
User debian-tor option is used by default in Whonix and Debian package, we may use
sudo tor here.