LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 12-21-2005, 06:29 PM   #16
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,014

Rep: Reputation: 115Reputation: 115

Mounting a device to a folder hides the previous contents of the folder, and the contents of the tmpfs mount would be zilch. I am not really sure what /etc/skel is all about exactly, but I have heard that it is used as the initial state of newly created accounts. In order to make a permanent base config for the account, you could make a directory called /home/allbase and copy the config over from there when the computer boots by doing "cp -r /home/allbase/.* /home/all" in rc.local(in Slack). To set it up, you would just configure the account the way you want(can do this even in tmpfs mode) and copy all the hidden files over to the base by switching the directories.

You may have better luck using IceWM or TWM for desktop cause it is simpler and the system-wide config would be used in the all account without any copying of hidden files. If all the user would be allowed to do is browse with firefox, you could not use a WM at all!

A tutorial post seems like a cool idea, and I would probably not be able to do it cause I can't explain in a good way the first time around(as you have experienced).

Personally, I haven't actually done anything like this to my own box and have just been thinking about doing it. The greatest thing about Linux(and Slackware) is that things usually work the way I expect them to and so I can perform pretty deep thought experiments without actually touching my box.
 
Old 12-27-2005, 11:48 AM   #17
lukeprog
Member
 
Registered: Oct 2005
Posts: 92

Rep: Reputation: 15
How would I use no window manager at all for the all profile and still use Firefox (have it startup upon login)?

If you're getting annoyed with my questions, let me know BEFORE you get mad, please. :-) I really am trying my best to figure all this out, but it seems like so much of the available documentation on Linux doesn't apply exactly to Ubuntu, and therefore the documentation on Ubuntu is incomplete.
 
Old 12-27-2005, 02:13 PM   #18
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,014

Rep: Reputation: 115Reputation: 115
/home/all/.xinitrc
Code:
#!/bin/sh
firefox
When you close down firefox, it logs out like normal WM's.
 
Old 01-12-2006, 02:48 PM   #19
lukeprog
Member
 
Registered: Oct 2005
Posts: 92

Rep: Reputation: 15
That .xinitrc thing has no effect in Ubuntu. I still haven't had time to try tmpfs, though. I can't seem to keep the all user from modifying stuff, though. I can delete the last GNOME panel, and then the all user can simply add a main menu to it, get to the config editor, and make some lasting change (I tried it) to the whole system, which tmpfs won't protect against. Can I load the whole freakin' computer to a tmpfs when it boots up, or something, so that all changes will be written to a temporary mount, and then when I reboot it'll revert to how it was before?
 
Old 01-12-2006, 04:20 PM   #20
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,014

Rep: Reputation: 115Reputation: 115
A normal user shouldn't have the priveledge to make any changes outside of their home directory, which would get refreshed every reboot. If a normal user can make such system-wide changes, then Ubuntu broke the permissions system natural to *nix. Use Slackware!
 
Old 01-20-2006, 08:56 AM   #21
lukeprog
Member
 
Registered: Oct 2005
Posts: 92

Rep: Reputation: 15
I'm not keen on Slackware; it's "for geeks only" (install doesn't track dependencies, etc.).

Just thought of something I'll try which might be simpler than tmpfs and /etc/skel/ and all that: I'll make every file in the user account's home directory read-only, along with the home directory itself so they can't create or delete files (for example, launchers on the desktop).

I'm hoping this will do the trick:

chmod -R 444 /home/all/
 
Old 01-20-2006, 09:11 AM   #22
lukeprog
Member
 
Registered: Oct 2005
Posts: 92

Rep: Reputation: 15
Lol, that definitely didn't work; that would be too easy! I couldn't even login all the way. Apparently it needs to write some to the user directory for normal use. Guess I'll have to try that tmpfs trickiness!
 
Old 01-24-2006, 12:24 PM   #23
lukeprog
Member
 
Registered: Oct 2005
Posts: 92

Rep: Reputation: 15
Amazing! I'm still a little thick-headed about exactly what tmpfs does, but it seems to be working! Here's what I did:

1. I'm now using Xandros, because it's easy to install and configure, and
runs KDE so I can use the KDE Kiosk Admin tool. I created an "all" account
and configured its profile with the Kiosk Admin tool (from the root
account) so that patrons can't bring up context menus, etc. from the "all"
account.
2. I added the tmpfs fstab entry. Here's my /etc/fstab file:

Code:
# /etc/fstab -- static file system information
# auto generation: on
# generated by: /sbin/etcdev2fstab
# 
# NOTE: to make this file readable, it has been formatted for 132 columns
# 
#<device>                              <mountpoint>      <fstype>  <options>                                       <dbg> <pass>
/dev/hda2                               /                 reiserfs  rw                                              0     0
/dev/shm                                /home/all         tmpfs     defaults                                        0     0
/dev/cdroms/hdc                         /media/cdrom0     iso9660   ro,nosuid,nodev,exec,user,noauto,async,unhide   0     0
/dev/floppy/0                           /media/floppy0    auto      rw,nosuid,nodev,exec,nouser,noauto,async        0     0
proc                                    /proc             proc      rw                                              0     0
usbfs                                   /proc/bus/usb     usbfs     rw,devmode=0666                                 0     0
/dev/hda1                               none              swap      sw                                              0     0
3. I rebooted the machine and played around to see how it works.

If I login as all and make changes (delete a Desktop shortcut, for
example), then reboot, the changes do not remain. If I only log out and
log in, the changes remain until I reboot. If I make changes with the KDE
Kiosk Admin tool as root and then reboot, changes remain (this is how I
want it anyway, yay).

As root, looking at my filesystems I see / and /home/all. The second is
obviously my tmpfs mount, which wasn't there before I added the fstab
entry. If I make changes in the /home/all mount as root and then reboot, changes do not remain.

What is confusing to me is that if I make changes as root to /home/all
under the normal / filesystem, the changes still do not remain when I
reboot. Shouldn't they remain, since they are "under" or "before" the
tmpfs mount? I assume the all profile is actually looking at the /home/all
tmpfs mount, rather than /home/all under the / filesystem, and that is why
changes don't stick when made from the all account. But why don't changes stick when made as root to the /home/all folder under the / filesystem?

I am getting one error message when I login as all since I added the fstab
entry:

Code:
First Run Wizard

Creation of date time page failed.

File: ../../../src/desktop_wizard/desktopwizard.cpp Line: 331

Please report this to Xandros as a bug
This is probably a Xandros issue, not a Linux issue. I searched and didn't find any desktopwizard.cpp file in my filesystem.
 
Old 01-27-2006, 09:35 AM   #24
lukeprog
Member
 
Registered: Oct 2005
Posts: 92

Rep: Reputation: 15
tmpfs and the Kiosk Admin tool work fine by themselves, but when they are both affecting a Linux user account together, they battle. I tried dozens of possible combinations of configurations and they always mess each other up. So, I'm going to look for another solution. Thanks for this tmpfs idea, tuxdev; it does work as it should, when it's not fighting with the Kiosk Admin tool.
 
Old 09-28-2008, 04:00 PM   #25
khanjar
LQ Newbie
 
Registered: Sep 2008
Posts: 1

Rep: Reputation: 0
what about this script?

Make a bash script named deepfreeze with this content first.
-------------------------------------------------------------------------
#!/bin/bash
# Deepfreeze a la Linux
# Backup before use, Use At Your Own Risk
# Copyleft 2007 by A. Hardiena
# Translated by fortmunir

Xdialog --title "Deepfreeze ala Linux" \
--menubox " Welcome to Deepfreeze ala Linux." 17 65 3 \
"Install" "Install Deepfreeze" \
"Remove" "Remove Deepfreeze"
"Abort" "Abort Installer" 2>/tmp/checklist.tmp.$$

choice=`cat /tmp/checklist.tmp.$$
rm -f /tmp/checklist.tmp.$$

case $choice in
"Install"

ask=`mktemp -q /tmp/menu.XXXXXX`
header="Deepfreeze ala Linux"
size="9 60"
content="Home folder you want to protect."
Xdialog --title "$header" --inputbox "$content" $size 2> $ask
if [ ! $?= 0 ]; then exit 0
fi

directory=`cat $ask`
check=`cat /etc//rc.d/rc.local | grep `# Deepfreeze System'`
temporary=" Deepfreeze System"

if [ "$check" == "$temporary" ]; then
sed -i "/# Deepfreeze/d" /etc/rc.d/rc.local
rm /home/$directory.tar.gz
fi
# Processing Deepfreeze and put to /etc/rc.d/rc.local
cd /home/
rm $directory.tar.gz
tar -cf $directory.tar $directory
gzip --best $directory.tar
cat << EOF >> /etc/rc.d/rc.local
# Deepfreeze System
cd /home/ # Deepfreeze do not manual editing this line
rm -f /home/$directory # Deepfreeze do not manual editing this line
# Deepfreeze has ended here
EOF
# Check if autorecovery has errorr
if [ $? = 0 ]; then
content="Deepfreeze home $directory success."
else
content="Deepfreeze home $directory failed."
fi

Xdialog --title "Header" --magbox "$content" $size
;;
Remove)
ask=`mktemp -q /tmp/menu.XXXXXX`
header="Deepfreeze ala Linux"
size="9 60"
content="Home folder you want to protect."
Xdialog --title "$header" --inputbox "$content" $size 2> $ask

if [ ! $? = 0 ]; then
exit 0
fi

directory=`cat $ask`
------------------------------------------------------------------------


If your distro doesn't use rc.d but init.d, You should change position of rc.local from /etc/rc.d/ to the right directory.

The last step is change the mode
chmod +x deepfreeze

Just double cliks it to activate. Or type in your console sh deepfreeze


*************************************************************************
i got an error while executing that!

any sugestion!?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 09:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration