site  contact  subhomenews

Shell wrapper for sudo

April 22, 2024 — BarryK

I posted about sudo here:

Which has brought this issue back to my attention. I really don't know why sudo was working and then it wasn't.

Anyway, I developed a simple alternative, named 'sudo-sh', see these blog posts mid-2023:

But what about an app that calls the sudo executable? EasyOS doesn't have sudo, QV does but it doesn't work.

To fix this, I created a shell script named 'sudo'. I don't know if an app will refuse to run it, if it sees it isn't a binary executable, or doesn't have suid bit set. Also, it ignores all commandline options. Anyway, here it is, /usr/bin/sudo:

while [ -n "$1" ];do
case "$1" in
case "$1" in

if [ -n "$C" ];then
exec sudo-sh ${PPID} ${C}

This will only work in EasyOS and QV, that have sudo-sh. A simple test:

# su spot
# sudo urxvt

...a window pops up asking for the root password, then the urxvt terminal runs.

That sudo script is very simple, could be written in C.   

Tags: quirky