The time now is Wed 19 Jun 2013, 07:59
All times are UTC - 4 |
|
Page 1 of 1 Posts_count_1 |
|
| Author |
Message |
droope

Joined: 31 Jul 2008 Posts: 814 Location: Uruguay, Mercedes
|
Posted: Thu 21 Jul 2011, 18:08 Post_subject:
lower Sub_title: runs command as non-priviledged user |
|
Hi folks!
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: | #!/bin/bash
if [[ -n $@ ]]; then
# allows gtk to run
xhost local:lower@ > /dev/null
sudo -H -u lower $@
else
su lower
fi |
In order for it to work, you need sudo, which I attach below. Created using this guy's code ( thanks! ). Also, you need to create the "lower" user, which can be done with
Usage:
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
or
( you can use "exit" command to become root again )
| Description |
|

Download |
| Filename |
sudo-1.7.4.pet |
| Filesize |
365.63 KB |
| Downloaded |
144 Time(s) |
_________________ What seems hard is actually easy, while what looks like impossible is in fact hard.
“Hard things take time to do. Impossible things take a little longer.” –Percy Cerutty
Mi blog (Spanish)
|
|
Back to top
|
|
 |
|
|
Page 1 of 1 Posts_count_1 |
|
|
|
Rules_post_cannot Rules_reply_cannot Rules_edit_cannot Rules_delete_cannot Rules_vote_cannot You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|
[ Time: 0.0389s ][ Queries: 13 (0.0067s) ][ GZIP on ] |