Unprivileged - run Programs as restricted user

Stuff that has yet to be sorted into a category.
Post Reply
Message
Author
User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

Unprivileged - run Programs as restricted user

#1 Post by MU »

I tested this in Muppy 008.3 (Puppy 3) only.

Download (75 kb):
http://dotpups.de/puppy3/dotpups/System ... ileged.pup
mirror:
http://puppyfiles.ca/dotpupsde/puppy3/d ... ileged.pup

This utility allows you to run a program with a click on an icon on your desktop.
The programs will be run as unprivileged user, like "Mark", not as "root".
You can create a new user very easily using a script I wrote.

IMPORTANT:
many programs use /tmp, which is write-protected for other users than root.
To change that, type:
chmod 777 /tmp


Here is the readme.txt:

unprivileged: run programs as unprivileged user with a click on the Rox-Desktop.


To create a new user with restricted permissions,
type this in a console:

createuser tester tester
(this creates the user tester for the group tester).

Now drag the script
/usr/local/Unprivileged/unprivileged
on your desktop.

Right-click it, and choose "edit entry".
Add as parameters the username and the comand to execute, like:
tester seamonkey

Now if you click on that icon, seamonkey is launched as unprivileged user "tester".
You can see the new settings-folder in /home/tester/.mozilla (a hidden folder).


------------------------------------------------------------------------
You will find some utilities to manage users and groups in
/usr/local/Unprivileged/bin/
To see the help, visit
http://noforum.de/man
You can read the man-pages for those comands there.

This package uses files from Tinylogin:
login
tinylogin
su
sulogin
http://distro.ibiblio.org/pub/linux/dis ... in-1.4.pet

And from shadow:
groupadd
groupdel
useradd
userdel
http://riksun.riken.go.jp/pub/pub/Linux ... 486-11.tgz

And from the coreutils:
groups
id

To run these comands, enter this in a console:

export PATH=/usr/local/Unprivileged/bin:$PATH

Then the comand, like this to show all groups, that the user tester belongs to:
groups tester

To see all groups:
cat /etc/groups

To see all users:
cat /etc/shadow

------------------------------------
This post includes a utility, to run the whole X as user, not as root:
http://www.murga-linux.com/puppy/viewto ... 9&start=60

Mark
Last edited by MU on Tue 07 Oct 2008, 14:13, edited 1 time in total.
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#2 Post by MU »

there was a small bug, corrected.
Also note, that /tmp must be writable for programs like seamonkey.
Updated first message.
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#3 Post by MU »

there was another bug setting the group, fixed now.
Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

koolie
Posts: 518
Joined: Mon 12 Mar 2007, 06:38

#4 Post by koolie »

.
Truly excellent, Mark.

.

Irihapeti

#5 Post by Irihapeti »

I tried this with Seamonkey. It runs, but for some reason the menus at the top of the screen don't display, and neither do the little icons at the bottom left (email client, html editor etc). Naturally, I find this a bit frustrating. What could I do to get this to work?

I also tried with Firefox - that is, the standard tarball downloaded from Mozilla. I got an "access denied" message, even though I'd run chmod -R 777 /opt/firefox/firefox. Again, what could I be doing wrong here?

I'm running Puppy 2.17, if that makes any difference.

koolie
Posts: 518
Joined: Mon 12 Mar 2007, 06:38

#6 Post by koolie »

I am running 2.17.1.
Works fine for me using Firefox or Opera.
I dont use Seamonkey.

You dont need to chmod anything but /tmp.

Hope that helps.

Irihapeti

#7 Post by Irihapeti »

Actually the message is "cannot run /opt/firefox/firefox Permission denied." (My previous message was from memory.) I still can't figure out what's happening.

I'd prefer to run FF as a restricted user because I share the profile with another OS (on the same computer) and running as root causes the other OS to have difficulty accessing some of the files.

koolie
Posts: 518
Joined: Mon 12 Mar 2007, 06:38

#8 Post by koolie »

then make firefox executable by "others" or "all".

If you are nor familiar with commands, install XFE (the best filemanager) and all this stuff is easy.

cheers.

koolie
Posts: 518
Joined: Mon 12 Mar 2007, 06:38

#9 Post by koolie »

I didnt mean to make a double post.
I got error msgs when posting.

But seeing that this one is here, I'll alter it.

XFE is here
http://dotpups.de/dotpups/File_Managers/Xfe-1.0.4.pup

and probably need FoxLibraries as well, from same site.

Firefox directory is usually under /usr/lib, for some odd reason.
(I know Mandriva and some others install it under /opt)
It may pay to move it there if you are having any hiccups.

It would probably be wiser to install Firefox locally (in tester),
and do your own thing, avoiding any conflicts with the other user or OS.

Post Reply