Re: Customize guest session
i manage to solve this.
i logged in with a guest session and launched for example Skype - then switched user to my regular account. In the terminal i used sudo nautilus and then i went into /tmp/guest-xxxxx/ folder. There i found a .Skype folder - i copied it and pasted it in the folder /etc/skel . Worked great!
However i also want to set the guest-session to automatic log out if system is idle for X minutes. How can i do that?
Re: Customize guest session
Quote:
Originally Posted by
Feppa
... There i found a .Skype folder - i copied it and pasted it in the folder /etc/skel . Worked great!
Well, unless you want that setting by default also for newly created regular users, you'd better use /etc/guest-session/skel instead. See the Alternative approach section in the tutorial.
Quote:
Originally Posted by
Feppa
However i also want to set the guest-session to automatic log out if system is idle for X minutes. How can i do that?
I for one have no idea; I doubt that it can be done using the techniques mentioned in this tutorial.
Re: Customize guest session
I appreciate all of the discussion about customizing the guest session. I have been looking for a way to have a easily cusomizable guest session for a kiosk-type setting under oneiric. After looking through everything, I have found that using a variant of the Alternate Method (above) has made it easy to customize the guest user using all of the regular gui controls (Ubuntu-Tweak, MyUnity, Startup App Prefs, etc.). Before logging out of the session, it is necessary to copy the files from the home directory of the temporary guest account to /etc/guest-session/skel. One advantage of this is that a guest session can be restarted, edited and saved as often as you would like. I realize that I haven't created anything new here; just put together the pieces differently from the posts in this thread.
Anyhow, the steps are as follows:
Quote:
- Create the directory /etc/guest-session/skel
- While logged on under an admin account, start a guest session
- Make any changes to the guest session that you want using whatever tools/utilities you wish
- Change back to admin account and open a terminal
- cd to /tmp and find the temporary guest home directory (guest-XXXXX).
- Copy the files in the temporary guest home directory to /etc/guest-session/skel using the command: ‘sudo cp -rT /tmp/guest-XXXXX /etc/guest-session/skel’.
- Log out of the guest session and login again to check.
- To update the settings, repeat steps 2-7 as necessary.
I previously wrote: I also have a question that you all might be able to help me figure out. I created a login user (luser) and attempted to edit the /usr/share/gdm/guest-session/guest-session-setup.sh file to copy /home/luser in step 6. However, it keeps defaulting to /etc/guest-session/skel/ Is there another file that I should be editing? It sure would be change things in an existing user rather than having to run (and rerun) a guest session.
Thanks to Gunnar, I have included directions for using a regular user account on the system as the basis for the guest-session account. Although this is not as flexible as the system outlined by Gunnar, it has the advantage of ease. I have tried this with 11.10; it seems that there may be differences with previous versions. I have not addressed those.
Quote:
- Create a standard (non-administrator) account.
Note: I will use the account name luser for this account in the rest of the instructions (luser means Login User. Really. ;) ). - Log into the luser account and make any changes that you want using whatever tools/utilities you wish.
- Once you have made the desired changes, log out of the account and return to an administrative account.
- Edit the file /etc/guest-session/prefs.sh (if it doesn't exist, enter the command "sudo touch /etc/guest-session/prefs.sh") and add the following lines to the top of the file:
cp -rT /home/luser "$HOME"
chown -R $USER:$USER "$HOME" - Save the file.
- Log into the guest account (either from LightDM or from the user-session indicator) and check that all changes have been made.
- To update any settings, simply repeat steps 2&3.
Note: As a security measure, you may want to disable the luser account when not editing it.
Please feel free to let me know if there are any further changes/instructions for these directions.
Peace,
Paul :cool:
BTW, I found out that Chrome won't run in a guest session due to needing suid for sandboxing. I have stuck with Firefox for the guest session.
Re: Customize guest session
Great example, Paul. Thanks! I added a link to your post from the "Alternate approach" section in the tutorial.
Quote:
Originally Posted by
p-dh
I created a login user (luser) and attempted to edit the /usr/share/gdm/guest-session/guest-session-setup.sh file to copy /home/luser in step 6. However, it keeps defaulting to /etc/guest-session/skel/ Is there another file that I should be editing?
Please note that as from Ubuntu 11.10, the guest session code is included in the LightDM package; you may well remove the gdm-guest-session package. So it's probably /usr/sbin/guest-account you want to edit.
Quote:
Originally Posted by
p-dh
I found out that Chrome won't run in a guest session due to needing suid for sandboxing. I have stuck with Firefox for the guest session.
It would be great if you could file a bug report about that. It's the LightDM package such a bug should be filed against.
Re: Customize guest session
Quote:
Originally Posted by
p-dh
Edit the file /usr/sbin/guest-account and change the line gs_skel=/etc/guest-session/skel to gs_skel=/home/luser. (sudo gedit /usr/sbin/guest-account)
A disadvantage with editing a package file is that it needs to be redone after each upgrade. Probably better to create a symlink.
Code:
sudo ln -s /home/luser /etc/guest-session/skel
Re: Customize guest session
Hey Gunnar,
I added the link as per your directions, but the files were not copied over. What am I missing?
Thanks for helping me get this to work.
Peace,
Paul :cool:
Re: Customize guest session
Quote:
Originally Posted by
p-dh
I added the link as per your directions, but the files were not copied over. What am I missing?
Seems like I'm the one who missed things. :(
A working way to do what you want, without a need to redo it after each lightdm update, seems to be to create /etc/guest-session/prefs.sh and add these commands to it:
Code:
cp -rT /home/luser "$HOME"
chown -R $USER:$USER "$HOME"
If /etc/guest-session/prefs.sh exists already, since you installed the tarball of this tutorial, those commands should be added to the top of the file.
Re: Customize guest session
Gunnar, Thanks for the last post. I created the file and it works great! I found that the reason a simple link doesn't work is that /usr/sbin/guest-account has the line:
gs_skel=/etc/guest-session/skel and needs gs_skel=/etc/guest-session/skel/ for cp to work with a soft link. Weird. But, this meant that I had to edit the file after updating LightDM today. Aaargh..
Anyhow, I will include your additions to my post above. I have tried it out and it really works well.
Thanks for all of your work on this.
Paul :cool:
P.S. Where can I find the documentation for LightDM and the files it uses for logging in?
Re: Customize guest session
Quote:
Originally Posted by
p-dh
I will include your additions to my post above. I have tried it out and it really works well.
Thanks for all of your work on this.
You're welcome, and thank you.
Quote:
Originally Posted by
p-dh
Where can I find the documentation for LightDM and the files it uses for logging in?
I'm not aware of any documentation besides the source code. And that's not easy to grasp. :neutral:
Re: Customize guest session
Quote:
Originally Posted by
p-dh
I found that the reason a simple link doesn't work is that /usr/sbin/guest-account has the line:
gs_skel=/etc/guest-session/skel and needs gs_skel=/etc/guest-session/skel/ for cp to work with a soft link. Weird. But, this meant that I had to edit the file after updating LightDM today. Aaargh..
Nice catch, Paul. I proposed that change of the source for lightdm in Ubuntu, and it was just approved. It means that next release will include such a trailing slash, so you may want to change comment #23 once again. ;)