Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 27 Nov 2014, 19:14
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » System
lower
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [1 Post]  
Author Message
droope


Joined: 31 Jul 2008
Posts: 814
Location: Uruguay, Mercedes

PostPosted: Thu 21 Jul 2011, 18:08    Post subject:  lower
Subject description: 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 ) Very Happy

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

Code:
adduser lower


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

Code:
#lower firefox


or

Code:
#lower
#firefox

( you can use "exit" command to become root again )
sudo-1.7.4.pet
Description 
pet

 Download 
Filename  sudo-1.7.4.pet 
Filesize  365.63 KB 
Downloaded  198 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
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » System
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0415s ][ Queries: 12 (0.0044s) ][ GZIP on ]