←back to thread

466 points CoolCold | 1 comments | | HN request time: 0.205s | source
Show context
ccorcos ◴[] No.40220178[source]
Can someone explain what this is / how it works to someone who has done a considerable amount of programming but lacks this kind of operating system level knowledge?

I was under the impression that ‘sudo’ was baked into the entire system. Like ‘cd’ or ‘ps’. How exactly can you just swap out sudo? Does that involve swapping out chmod as well?

replies(8): >>40220205 #>>40220206 #>>40220219 #>>40220224 #>>40220238 #>>40220277 #>>40220342 #>>40222121 #
ErikBjare ◴[] No.40220219[source]
sudo is just another program, it's not "baked in" as such. It just ships with many (not all) distros. I remember having to install it from repos in the past on a new system: https://github.com/sudo-project/sudo
replies(1): >>40226574 #
1. ErikBjare ◴[] No.40226574[source]
Reminds me of an assignment I had at uni to implement sudo in C. You get elevated permissions using the setuid bit, and can verify the password of $USER against /etc/passwd.