Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

387
Views
Building a switch user tool: How to gain root permissions without dependencies

I've been trying to make my own sudo program in Python, but I don't want to have any dependencies (like su or pkexec). How would I gain root access? Ideas:

  1. Have the file always have root access (with chmod +[smth])
  2. Somehow login as root (maybe with subprocess)
  3. Use something built in (kind of a low-level dependency) and pass it the root password.

How would I do any of these or is there a different way? Or is Python even low level enough to do this?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

If it's not a project and the goal is only to not have sudo dependencies while having root access, there are some sudo alternatives. Use at your own risk, I have no experience with these. Also, I don't see pkexec or su being dependencies on the Arch or Ubuntu packages sites, but on Arch you can always force remove packages without removing any dependencies by using sudo pacman -Rdd package_name.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!