Search
Star
1.4k
Feedback
Setup for Free
C
C#
•
2y ago
•
6 replies
bakane
How to check if program is running as root on Linux
I need my program to be run as sudo to function
, so I want to exit if it
's not
. How can I check if the program is running as root
? I can
't find any method that gets you the euid
.
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,376
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Similar Threads
Running MongoDump from C-Sharp Program in Linux Docker Container
C
C# / help
4y ago
✅ How is Environment.UserInteractive set on Linux?
C
C# / help
3mo ago
❔ Check if Type is static
C
C# / help
3y ago