LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Can superuser prevent a KDE 4.6user from deleting icons from his desktop? (https://www.linuxquestions.org/questions/linux-desktop-74/can-superuser-prevent-a-kde-4-6user-from-deleting-icons-from-his-desktop-869891/)

lewster 03-20-2011 11:34 PM

Can superuser prevent a KDE 4.6user from deleting icons from his desktop?
 
Despite repeated pleadings from me, my elderly father has been deleting all of his desktop icons (KDE 4.6, openSUSE 11.3). I lock the widgets, but somehow he manages to unlock the widgets AND delete everything he can. Then I have to restore his desktop again. He's not deliberately malicious; he just tries stuff out when he forgets how to, say, bring up google.

I've tried changing the ownership and permission bits of my dad's icons, but either KDE allows him to delete them anyway, or else the icons turn into nonfunctional white rectangles.

I've also looked into kiosking, but the software I've found seems to lack recent support.

Another factor to take into consideration: I must administer my father's system through ssh because he and I live 1000 miles from each other. I use nomachine's nx when I can, but it's not always available, so a CLI solution would be preferable to a GUI one.

Thanks in advance for any ideas.

JZL240I-U 03-21-2011 08:25 AM

Can't you lock his /.desktop file using permission / ownership?

bluebox 03-21-2011 11:30 PM

Quote:

Then I have to restore his desktop again.
How do you do this? What about a chron job, restoring his desktop ... say ... hourly?

lewster 03-22-2011 02:12 AM

Quote:

Originally Posted by JZL240I-U (Post 4297973)
Can't you lock his /.desktop file using permission / ownership?

Thanks kindly for the response, JJZL240I-U. There is no /.desktop file, but perhaps you meant the ~/Desktop directory? That's what I assumed.

In any case, your suggestion was an interesting one, and I learned a few things by following it, including how to describe the problem more precisely. I said in the original post that my father deletes his icons. It's more accurate, however, to say that he makes them go away by unlocking widgets and then deleting the panel that contains his icons. The icon files remain in ~/Desktop; You just can't see them.

Also, I've learned that when I delete the ~/.kde4 directory and reboot, his old icons return, with the widgets unlocked and therefore vulnerable to my dad's tendency to delete things. That's better than nothing, of course, and another responder suggested that I just cron a restoration periodically.

Finally, I've concluded that the problem is plasma issue, not a file permission bit issue. (Apologies for possibly using wrong terminology here; I need to learn much more about KDE 4.6 and plasma). Consider this experiment and its results: I set all of ~/Desktop's 9 permission bits to zero. I expected that the user could do nothing on the desktop, but in fact he can still unlock the desktop widgets and delete panels. Apparently the software designers decided that plasma configuration tools will ignore file permission bit settings. A user can delete whatever that user wishes, even if to do so conflicts with permission bits.

Anyway, I believe that a solution to this problem lies not in how to configure permission bits in ~/Desktop or that directory's contents. Perhaps it's possible to configure plasma? Again, I'm not real familiar with that part of the system.

Thanks again.

lewster

lewster 03-22-2011 02:26 AM

Quote:

Originally Posted by bluebox (Post 4298739)
How do you do this? What about a chron job, restoring his desktop ... say ... hourly?

Thanks for the interesting idea, bluebox. When my dad began screwing up his desktop several weeks ago, I found out that you can recover the default desktop by deleting the ~/.kde4 directory and rebooting. When the user logs in the next time, the system will create a new directory, and the user will see a new desktop.

Yeah, it would be real easy to write a short script program to do this automatically with cron. One complication I've discovered, however, from doing it manually. By default a new desktop's widgets come unlocked. As I implied in my original post, my father tends to futz around and click on things when he forgets how to do something, so it would be better to have locked widgets in his new desktop, so he'd have one more obstacle before he can cause damage. But your idea is a practical remedy. Thanks.

lewster

JZL240I-U 03-22-2011 04:27 AM

Hi lewster ;).

Quote:

Originally Posted by lewster (Post 4298846)
...There is no /.desktop file, but perhaps you meant the ~/Desktop directory? That's what I assumed.

Yes, of course. I was in a hurry when I wrote my suggestion.


Quote:

Originally Posted by lewster (Post 4298846)
...In any case, your suggestion was an interesting one, and I learned a few things by following it, including how to describe the problem more precisely.

:D

Quote:

Originally Posted by lewster (Post 4298846)
...Also, I've learned that when I delete the ~/.kde4 directory and reboot, his old icons return, with the widgets unlocked and therefore vulnerable to my dad's tendency to delete things.

Would be "locking" ~/.kde4 by permission and owner give you a chance to achieve your goal?

Quote:

Originally Posted by lewster (Post 4298846)
...I set all of ~/Desktop's 9 permission bits to zero. I expected that the user could do nothing on the desktop, but in fact he can still unlock the desktop widgets and delete panels ... A user can delete whatever that user wishes, even if to do so conflicts with permission bits.

Next step might be the use of ACLs.


Quote:

Originally Posted by lewster (Post 4298846)
...Anyway, I believe that a solution to this problem lies not in how to configure permission bits in ~/Desktop or that directory's contents. Perhaps it's possible to configure plasma? Again, I'm not real familiar with that part of the system.

Neither am I, sorry :(.

bluebox 03-22-2011 10:26 AM

Yes, this is a plasma problem, not a file permission problem. But, as plasma has to store its configuration somewhere, the problem should be trackable down to a file permission problem.

Or, to be more precisely, it is a "desktop preconfiguration problem"

I'm quite new to KDE 4. As far as I understood, there is no "icons" anymore in KDE 4, everything is a "plasmoid". I don't know whether there is a way to lock locked plasmoids in an unlockable way. But the configuration has to be stored somewhere in /home/, so it should be possible to set up a preconfigured configuration when e.g. the user logs in.

Maybe, the easiest way would be to write a script that restores the desired state of the desktop and put it into autostart. Your dad would still be able to sabotage this, but as you said, he is not malicious, so probably he will not do so.

Edit: I rethought about this ... maybe it's not a good idea to change the KDE config via KDE autostart. The KDM startup scripts would be a better place. See "man kdm".

Anyways ... configure the desktop the way it should be including locked plasmoids, log out of the session, backup the .kde4 directory and restore the backup whenever your dad logs in.

End of edit.

A cronjob would be the "hard" way to do this.

Quote:

to say that he makes them go away by unlocking widgets and then deleting the panel that contains his icons.
Are we talking about this desktop panel window that comes with KDE 4? You can configure it to expand over the whole desktop, so it is not obviously a "closable window" anymore, but just "the desktop". Maybe this prevents him from deleting this panel.

btw, what about just adding the commands he needs to the KDE menu? Maybe to "favourites"?

lewster 03-30-2011 02:50 PM

Another solution : hide the cashew
 
Thanks bluebox and JZL240I-U. Sorry for not getting back much sooner, but life distracted me. In any event, I think I found a practical, if inelegant solution: You can drag and drop the plasma cashew to any point on the periphery of the desktop. When it's dragged to the same corner as the application launcher, the cashew disappears behind the launcher. And my dad would be very unlikely to find it there.

According to a number of sources, the plasma developers didn't provide a conventional means for hiding the cashew, or for preventing a user from unlocking widgets. I think that's a problem, but what do I know?

Again, I'm grateful for your responses, which led me to learn some interesting things.


All times are GMT -5. The time now is 10:36 AM.