You are not logged in.

#1 2010-04-01 22:10:29

RetroX
Member
Registered: 2009-10-17
Posts: 106

Simple Guest Account

I've now added this to the AUR.

To configure your guest account:
Run the daemon, log-in as your guest user, and then perform all of the configurations that you want with your software.  Then, copy everything in /home/guest to /home/guest-directory.  This can be achieved by executing this command: cp -R /home/guest -T /home/guest-permanent
You don't have to bother with read permissions; the daemon will fix them on boot.  Usually, I'd recommend that you delete the cache folders that most desktops and programs make, like .thumbnails.  The data should not be very big!  It shouldn't be much larger (if at all) than 100-200 KiB, otherwise, it might take a long time to boot!  If you set this as a background process, it might not work, because the files might not be finished copying when you finally log in.

The contents of /home/guest-permanent are copied (not linked) to the /home/guest directory on every boot.  On shutting down, /home/guest is deleted.

Add a list of files (bash syntax, recursive) to /home/guest-permanent/,keep to set certain files to be kept after shut-down.  These files will be copied from the guest directory into the permanent directory before shut-down.  This is most useful for high scores and other configurations.

I've found this to be very useful, and it works quite well for me.

Last edited by RetroX (2010-06-18 17:17:59)

Offline

#2 2010-04-01 22:16:12

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 679
Website

Re: Simple Guest Account

I haven't got a use for it, but it is cool, I bet some people especially sys admins could use it.  Well done

Offline

#3 2010-06-16 13:39:56

eldragon
Member
From: Buenos Aires
Registered: 2008-11-18
Posts: 1,026

Re: Simple Guest Account

i was about to set this up myself, you saved me a couple of hours of work wink

Offline

#4 2010-06-16 15:24:54

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,073

Re: Simple Guest Account

This is cool. I don't have a use for it, since most people who come to my house can't figure out how to use linux anyway. So they stay away from my computers -- which is a great deterrent in and of itself. smile


But I am intrigued, can you create a guest account and have that account access only a few software, for eg. a browser and openoffice.  My family, when they visit, do nothing more than those two things, so if they want to use the computer, I won't have to reboot and login to the otherwise idly lying around Windows. I can maybe even un-install Windows completely.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#5 2010-06-16 16:11:34

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 679
Website

Re: Simple Guest Account

Inxsible - Try this method I use and switch between window mangers (I believe you use i3 like me).  Switch to fluxbox and back again with out losing your open windows.  Then your friends can use that.  When they are done you switch back to i3.

http://bbs.archlinux.org/viewtopic.php?id=42670

Offline

#6 2010-06-18 16:36:05

RetroX
Member
Registered: 2009-10-17
Posts: 106

Re: Simple Guest Account

Hey, I forgot that this was here.  I've since made an update to the daemon.

Now, a .keep file in the guest-permanent directory acts as a list of files that will be kept from the guest directory when the directory is reset on shutdown.  I use this to keep game scores, etc, but I'm sure that it has other uses.

And, now, I've made it into an actual package.

Before updating, you should remove the old guest user (userdel -r guest) and backup your guest-permanent directory.  You should also delete the old daemon.

Last edited by RetroX (2010-06-18 17:12:15)

Offline

#7 2010-06-18 17:20:13

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,073

Re: Simple Guest Account

gazj wrote:

Inxsible - Try this method I use and switch between window mangers (I believe you use i3 like me).  Switch to fluxbox and back again with out losing your open windows.  Then your friends can use that.  When they are done you switch back to i3.

http://bbs.archlinux.org/viewtopic.php?id=42670

that does seem interesting if I want to switch between two wms without having to kill X and login again. But I was more interested in getting a guest account with lesser privs and maybe even access to only a couple of software. With what you have suggested, it seems that the guest will have access to everything that I have access to.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#8 2010-06-18 17:23:11

RetroX
Member
Registered: 2009-10-17
Posts: 106

Re: Simple Guest Account

Well, the problem with that is that there's no per-user execute permission.  The only think that I could think of is having a daemon run in the background and kill any process that isn't under a certain name. tongue

But then again, that wouldn't be very secure.

Why exactly do you only want to allow certain programs?

What I do is chmod everything to be untouchable by the guest account, and then allow my user account to do sudo mount without a password.  I mount my main files partition on login in GNOME, and then when the guest logs in, they can't access any of my files, nor can they mount the partition.  Of course, if I log off, the partition is still mounted.  I have to unmount it first in that case.

Last edited by RetroX (2010-06-18 17:25:22)

Offline

#9 2011-05-28 22:52:41

HalJordan
Member
Registered: 2010-11-17
Posts: 57

Re: Simple Guest Account

I hate to be a necromancer here, but is there any way to have the guest account reset after login?
Or have the guest-permanent be copied to a ramdisk, and that ramdisk be the guest users $home until they logout?
That way you prevent a lot of unecessary writes/deletes to the disk.
All you do is read from it, and only when the guest account logs in, not every time you reboot. It seems this would keep it from hindering your boot process as well.

Offline

#10 2011-05-29 00:14:07

RetroX
Member
Registered: 2009-10-17
Posts: 106

Re: Simple Guest Account

Yeah, I made this back when I did not have much bash knowledge, and I have since not touched it.

Copying to a ramdisk could work, although, it would be a very bad idea on systems where guest-permanent is large, or systems with little memory.

I do agree that it should only be messed with on guest login and logout, though.  It might make sense to make .bash_login/.bash_logout files with execute-only permissions that will do the copying/removing.  I might mess around with it tomorrow.

Last edited by RetroX (2011-05-29 00:15:20)

Offline

#11 2011-05-29 00:19:46

HalJordan
Member
Registered: 2010-11-17
Posts: 57

Re: Simple Guest Account

i have 4 gigs of ram, and dont intend guest to have anything more than skel and whats made when you login...

Offline

#12 2011-05-29 00:21:50

RetroX
Member
Registered: 2009-10-17
Posts: 106

Re: Simple Guest Account

Eh, I'm probably seriously underestimating how much memory that people have.  I have 4 gigs as well. tongue

I suppose that worst comes to worst, it'll use the swap file.  Either way, I'll see what I can do.

Offline

#13 2011-05-29 01:06:06

HalJordan
Member
Registered: 2010-11-17
Posts: 57

Re: Simple Guest Account

not trying to make demands just my insight.
and wondering how one would do the ramdisk part...

Offline

#14 2011-05-29 21:01:47

RetroX
Member
Registered: 2009-10-17
Posts: 106

Re: Simple Guest Account

Well, I figured that it'd be an interesting thing to have.  If you feel like messing around with the scripts, by all means, go ahead.

After a quick Google search: http://prefetch.net/blog/index.php/2006 … ith-linux/

I haven't actually tried it out, but that's probably what you'd end up doing.  .bash_login is called before anything else, so, it'd be pretty easy to create and mount a ramdisk to your home folder on login.

Offline

#15 2011-05-30 02:29:24

HalJordan
Member
Registered: 2010-11-17
Posts: 57

Re: Simple Guest Account

yes, but i was hoping to keep the guest as locked down andlow permission as possible, i was under the impression  that the guest wouldnt be able to accomplish this, i recall ubuntu having similar but have no clue how its done.

Offline

Board footer

Powered by FluxBB