Some apps are just not safe to be run as root - particularly my browser and my server - so I've decided that i don't want them to. In order to do so comfortably, I've created a script that lowers the privileges ( an anti-sudo, perhaps )
So, here it is:
Code: Select all
#!/bin/bash
if [[ -n $@ ]]; then
# allows gtk to run
xhost local:lower@ > /dev/null
sudo -H -u lower $@
else
su lower
fi
Code: Select all
adduser lower
Firstly, you need to create a text file in "/usr/bin" called "lower". Insert the first block of code of this post inside that file, and give it execution rights ( tip: `chmod +x /usr/bin/lower`)
After that, you can use it like this
Code: Select all
#lower firefox
Code: Select all
#lower
#firefox