Sample Header Ad - 728x90

Why some commands do NOT require sudo when logged in GUI?

0 votes
1 answer
261 views
I created a user called dummy. I login using Terminal into dummy and try to put Mac to sleep using pmset sleepnow. It does NOT work: Sleep error 0xe00002c1; You must run this as root.. I log into dummy using Fast User Switching in MacOS GUI. I switch back to my main user [keeping dummy logged in thanks to the Fast User Switching GUI]. I login again to dummy using Terminal and try pmset sleepnow. It's working now! 1. Why is that? 2. How does it work that the command requires sudo, unless I'm logged in the GUI [then it doesn't]? 3. What are other commands that magically start working if logged in using the MacOS GUI? EDIT: Previously I have thought it was like that because of the dummy being a "standard" account – I've just tested that it is the same issue for "administrator" accounts as well. Still, the questions remain: why/how does it matter, being logged in the GUI, for some commands to work.
Asked by MacDada (101 rep)
Oct 30, 2022, 12:07 AM
Last activity: Oct 30, 2022, 09:02 PM