Multiuser (or at least dual user :) ) puppy linux

A home for all kinds of Puppy related projects
Message
Author
User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#16 Post by Pizzasgood »

Sorry, been really busy lately. Finished my final final on Friday, moved out on Saturday, and now I'm living out of a suitcase at my grandma's for a couple days. I intend to start working for real on multiuser within a week or so, once I get done traveling and settle in.

My suspicion is that the change in permissions was due to udev. That's just a very slightly educated guess.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#17 Post by dejan555 »

Dr_Willis from #puppylinux chat said that /dev is generated on every boot by fly, so we need to set permissions for those dev files somewhere in rc maybe (rc.local, rc.sysinit) ?
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#18 Post by Pizzasgood »

/etc/rc.sysinit

Unless there is a file that specifies how /dev should be created each boot, in which case it would be best to use that.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#19 Post by Pizzasgood »

This project is not dead yet!

I wound up getting delayed and not being able to start working on it when I intended to. Then shortly after I did get started, I had some technical difficulties with my laptop. I salvaged all the data, but my laptop has such a small harddrive that I decided to just not bother doing any more until I got back from break and could use my real computer. I got back last weekend. So far I've restored my multi-user work and done a little more. I've implemented most of the stuff in this thread, minus the /dev/ptmx part, which is what I just came to the forum for (couldn't remember which file it was).

I'm also going to add the real 'useradd' program (and related stuff) so that it can make use of /etc/skel/ for creating the user's home directory.


I also didn't do anything about /etc/windowmanager yet. I had forgotten about that. Sticking it in ~/Choices/ sounds like a good idea.


Anyways, just thought I'd mention I hadn't given up or anything. I'd better get back to work. :)
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#20 Post by dejan555 »

Good to know :)
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

PaulBx1
Posts: 2312
Joined: Sat 17 Jun 2006, 03:11
Location: Wyoming, USA

#21 Post by PaulBx1 »

So... what is the intention here?

To me it would be cool if at some point (for example, when going through the dialog for saving the initial pupsave), the user is asked if he wants a single-user Puppy or a multi-user one. Then all the stuff you guys figure out will be done automatically for him. Of course this requires lobbying Barry...

However even if I may never use multi-user, I can see one huge benefit. Of all the reviews I've seen of Puppy, the largest complaint by far was booting as root. This removes the largest single drawback to adoption of Puppy, at least as far as reviewers are concerned.

Failing all that, a good "How To" would be OK, as long as it is made sticky (it's that important).

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#22 Post by dejan555 »

The intention here is not implementing this in official puppies, and I don't even think that using puppy as root is bad, but we wanna see here what's doable and try to apply all those hacks and then maybe collect all that and make some puplet, what you think Pizzasgood?
Anyway if we can make multiuser setup that means others can too. We can make some howto or just follow steps from this thread and I'm sure you could do same.
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#23 Post by Pizzasgood »

Well, I'd personally like to see Puppy adopt the changes.

My intention is to release a multiuser-friendly Puplet based on 4.2.1, and maybe a .pet or set of patches or something. I also intend to post exactly what I did to make it, so that other people can do the same things to other versions. It will also make it easier for people more knowledgeable than I to spot things I forget or do incorrectly.

That's especially important since I don't intend to maintain this. Multiuser Puppy is the last major Puppy commitment on my list before I go off to do other stuff. So I need to document it well so that other people can continue it if they want.

I have three motivations for doing this:
A linux distro that can't handle multiuser out of the box feels almost defective.
There are several cases where true multiuser support would be nice - particularly sharing with a family, especially with people (kids/siblings) who might "inadvertently" try to delete the harddrive, which the multiple pup_save.2fs method does nothing to guard against.
To put an end to the complainers.



It won't have any concept of "modes". Either you use it as root, or you make another user and use it as the other user. It will still default to root and not prompt for a login, so it can be used exactly how Puppy currently is, for people like me who prefer this way. I'll add a wizard to modify /etc/inittab to let the user optionally disable the auto-login though.


There are some things I don't intend to handle very elegantly. PetGet support in particular. That can't really be done properly in a mere puplet. So I'm just going to make that root-only, and people can copy config files into their home directories by hand if they need to. I will make a script that will copy /root into /etc/skel and do a little cleanup (fixing paths and symlinks, for example). I'm going to link that script to the createpuppy script in the unleashed tree I use to build it, so that it will come with an /etc/skel/ directory that's already populated.


I noticed that when starting X as a user, the ddcprobe command (used by xwin to see if the monitor has changed) complains about not having permission to use /dev/mem. I really don't think /dev/mem should be accessible by users, so I toggled the setuid bit on ddcprobe instead, so that the permissions on /dev/mem can be left restrictive. Maybe it would be better to just not have users use ddcprobe, but I don't really see anything wrong with it. I do intend to set up personal xorg.conf files so that users can have different resolutions and such.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#24 Post by disciple »

Pizzasgood wrote:Work to eat, eat to live, live to bike, bike to work.
Hey, I like that one :)

FWIW I think most people recognise that it would be good for Puppy to be multi-user capable.

Are you still working on that volume mixer too, Pizzasgood?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#25 Post by Pizzasgood »

Currently no, but I plan to get back to it again after I finish this. I have most of the functionality done and it's usable now. The main things missing are the menus so that you don't have to edit the config file to set your preferences. The code is all at Puppy's sourceforge page, and one of the last things I did with it last spring was get it working using the standard autotools deal, so that it uses the normal ./configure; make; make install process. I'm not making use of any configure options yet though.



Xvesa will work as a limited user, but you have to first set its setuid bit. You can also change the resolution while it's running, but only for that session. Still need to look at the xvesa wizard to find out where it stores the settings.

I edited the xwin script to replace instances of /etc/X11 with a variable, and added some code that detects whether /etc/X11/$(whoami)/xorg.conf exists. If it does, it sets the variable to /etc/X11/$(whoami), otherwise /etc/X11. If it exists it also sets the $XORGCONFIG environment variable to $(whoami)/xorg.conf, so that Xorg will use that version of the config file instead of /etc/X11/xorg.conf. So then all you need to do to allow a user to have his own Xorg configuration is create a directory with his name in /etc/X11 and chown it to him.

I also did that to xorgwizard and adjusted the paths to some temporary files, but it still didn't let me run xorgwizard as a limited user. The wizard uses 'Xorg -configure' to generate an initial version of the xorg.conf file, but Xorg refuses to let a non-root user run that. I'll have to have it bypass that part for limited users, and instead copy the existing xorg.conf file from /etc/X11/ (assuming there is one) and edit that, without building a new one.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

panzerpuppy
Posts: 632
Joined: Tue 02 Oct 2007, 07:39

#26 Post by panzerpuppy »

@Pizzasgood: Here's a bone for you:

http://distrowatch.com/weekly.php?issue ... 24#feature

;)

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#27 Post by Pizzasgood »

Didn't do much over the last week. Got Xvesa running and set up the video-wizard to store the preferences in ~/Choices/ so that it will be user-specific. I also adjusted the configuration of the passwd program so that it will work with passwords longer than 8 characters. And I wrote three gui wizards that let you enable/disable auto-login, add users, and change your password. The password wizard can actually be given a username as a commandline parameter and it will change that user's password instead (if you're root). The adduser wizard calls it that way after it finishes so that the new user can be given a password.

I'm going to try to clean up most of the main loose ends and upload a beta by next Sunday.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#28 Post by dejan555 »

Sounds cool Pizzasgood! Well done!
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#29 Post by Pizzasgood »

Okay, here's a beta:

< BETA REMOVED >
md5sum: 4b094160a5c55ed072e7737a90ccf218


The vast bulk of things should work, but this is a beta - there are a number of things that don't work, and a bunch of things I haven't even tested.

You must be root for most of the system configuration stuff (changing the date, mounting drives, configuring the network, etc.).

Limited users cannot use xorgwizard, nor choose between Xorg and Xvesa (actually, they could make the choice manually by copying the xwin script into their home directory and editing it, then using that one rather than the real one). If root gives them a directory named after them in /etc/X11 (for example, /etc/X11/pizzasgood), the limited user can manually set up an xorg.conf file in there and it should be used instead of the system-wide one in /etc/X11/. Limited users can run the video-wizard for Xvesa though.

Limited users can set their own timezone by hand by editing their ~/.bashrc file to set and export the TZ variable to point at the relevant timezone in /usr/share/zoneinfo. I might set up the timezone wizard to be able to do something like this automatically.

There are entries in the menu under setup to create new users and set your password. There is also an entry to set whether Puppy should automatically log in as root (naturally, you must be root to use those. Unfortunately, that goes for the password one too. Limited users will need to just use passwd for now. I'll see what I can work out for the next beta.).

The default behavior is to automatically log you in as root, just like normal Puppy. And it automatically relogs you if you log out, so if you want to actually log in as another user, you need to either disable the autologin, OR you could just push the left ALT key and F2 to switch to a different virtual terminal and log in there. (NOTE: Normally Puppy only has two virtual terminals set up, and a third used by X. However, for this one I set up terminals 1-6, with 7 used by X.)

Make sure X is shut down before you try starting another X as a different user.

The script that can populate /etc/skel based on /root is named populate_skel and accepts some options to specify the locations of /root and /etc/skel if you feel like using alternate locations. It also has some options to tell it how much effort to put into making the copied files multiuser-firendly. Note: in my experience, it seems to corrupt the copied seamonkey profile, so you probably want to run rm -r /etc/skel/.mozilla after using this).

It has already been used during creation so that /etc/skel starts out populated. If you use the '-m' option when running useradd, then /etc/skel will be used to create the user's home dir. (If you use the graphical wizard, it automatically uses the -m).


Fixmenus, xorgwizard, and petget all need to be run as root. I added code to fixmenus and petget to automatically exit if you aren't root, so that things that automatically run them don't spew a bunch of errors and waste time being confused. I previously worked on xorgwizard and got it nearly working for non-root users, but couldn't finish the job - it requires running "Xorg -configure" which only root can do. I didn't get around to adding the code to check that you're root because I thought I might try my hand at letting it edit an existing xorg.conf file, but I haven't gotten around to it. I'm not sure whether I will or not.

As for fixmenus, I don't really feel like wrapping my mind around how it works now and how to make it work for limited users. To really do the job properly, the system would need to be extended a bit so that it could detect which items are root-only and not bother putting them into the limited user's menus.


Most of the things in the desktop category of the menu should probably work. I played around with the JWM and Pwidgets stuff and they seemed okay. I couldn't use the icon changer or the wallpaper setter though. I'll look into those...

I did do some large-scale sed commands to replace most of the instances of '/root/' with '${HOME}/' in the misc. scripts in Puppy. I stayed away from the remaster scripts so far though - they shouldn't touch the limited users for the most part. It's concievable that somebody might want to set up a remaster that includes their limited user's settings too, of course. But since I have never used the remaster scripts (other than maybe twice to test something) and never intend to, I'm just going to leave them be. People more familiar with what the typical remaster-script users want can deal with them. AFAIK, they should still pick up all the changes that I've done so that remasters would be multi-user friendly too. (If something does need adjustment for that purpose, let me know!).


Users do have the ability to adjust the audio levels. The mixer in the tray didn't start up as a limited user, but alsamixer worked fine. I'll have to look into that more next.

Limited users do not get desktop drive icons. Also, I haven't looked at the pup_event system yet, so if you look in the error file you'll probably see lots of errors from that. Don't worry about it.

I don't know if limited users can print. Another thing I'll have to look into.
Last edited by Pizzasgood on Mon 21 Sep 2009, 03:27, edited 1 time in total.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#30 Post by disciple »

Cool.
You must be root for most of the system configuration stuff (changing the date, mounting drives
I wouldn't've thought mounting drives was system configuration... do you intend for it to stay like that?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#31 Post by dejan555 »

Hmm, cool, I'll test this later today. I do remember I did run xorg as spot but every next time i wanted to start X I had to delete some file in /tmp.
I also had desktop icons cause I remember I made it pick PuppyPin in xinitrc from ~/Choices/ROX-Filer/PuppyPin instead root's Pin, but if I changed icons theme it changed on both accounts.
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#32 Post by Pizzasgood »

disciple wrote:Cool.
You must be root for most of the system configuration stuff (changing the date, mounting drives
I wouldn't've thought mounting drives was system configuration... do you intend for it to stay like that?
By default. I'll look at adding a group with permissions to mount drives that users could be added to. But it definitely shouldn't be global. Multiple users aren't just about human users. Even in the stock Puppy, there are non-root users that are used by certain servers / services to make them safer. And one of the big reasons I want to see a multiuser Puppy is so that if somebody want's to let a child (or illiterate adult) use the machine for a bit, they can put them into a limited account so they don't accidentally erase the harddrive.

@dejan555: I set this up to add the user's name into the names of most of the temporary files X uses so that that shouldn't happen.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#33 Post by dejan555 »

Hi Pizzasgood, I'm on multi user pup right now, I booted it and set new user and disabled autologin in few minutes, very simple, then rebooted and logged in as limited user. Then I opened terminal and changed to root (su root) to setup my usb3g modem and it worked. It's good that you can use su in terminal and setup everything from there as root I thought, but there comes problem, seems like it doesn't find most programs in executable path? :?

Like, when I setup modem it gives me xmessage not found error then I tried pmount and there where bunch of other errors. yaf-splash, etc... I did mount the partition, but I couldn't access /mnt/sda* as limited user probably needs permissions. Couldn't change background or icon theme either. set global font doesn't work either, I expected that. Other then that, seems very good, I'm connected to net, listening radio stream in gxine and connected to chat... further testing continues :)
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

User avatar
dejan555
Posts: 2798
Joined: Sun 30 Nov 2008, 11:57
Location: Montenegro
Contact:

#34 Post by dejan555 »

On the other hand if i right click on icons, then go to set backdrop background changes, must be issue with pwidgets when resyncing background.
puppy.b0x.me stuff mirrored [url=https://drive.google.com/open?id=0B_Mb589v0iCXNnhSZWRwd3R2UWs]HERE[/url] or [url=http://archive.org/details/Puppy_Linux_puppy.b0x.me_mirror]HERE[/url]

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#35 Post by Pizzasgood »

For the messed up path, maybe try su - instead of just su. That way it should make sure the environment is initialized closer to what it does when you actually log in as root. (Yes, I do mean the su command followed by a space then a hyphen then just press enter. I didn't forget an option or anything.)

I haven't tested that here, but I noticed in another distro once that I needed to do that in order to have a proper path.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

Post Reply