Page 1 of 1

[Solved] The domain user usually deletes applications accidentally in the desktop!

Posted: Wed May 02, 2018 12:33 am
by ruyzz
Hello

I want to block applications .desktop, the domain user usually deletes applications accidentally.

It can be done manually with the terminal Ctrl + Alt + T:

Chttr + i /home/domain/user/desktop/*.desktop

But the PC, is used by "n" users.

Is there any way to do it automatically with an .sh file?

Greetings.

Re: The domain user usually deletes applications accidentally in the desktop!

Posted: Wed May 02, 2018 1:56 am
by catweazel
ruyzz wrote:
Wed May 02, 2018 12:33 am
Is there any way to do it automatically with an .sh file?
You can try adding the command to rc.local.

Code: Select all

sudo nano /etc/rc.local
Add the command in there before the line that reads exit 0.

ctrl-o <enter> to save, ctrl-x to exit, followed by:

Code: Select all

sudo chmod +x /etc/rc.local

Re: The domain user usually deletes applications accidentally in the desktop!

Posted: Wed May 02, 2018 7:08 am
by rene
ruyzz wrote:
Wed May 02, 2018 12:33 am
Chttr + i /home/domain/user/desktop/*.desktop

[ ... ]

Is there any way to do it automatically with an .sh file?
No need for a script: simply sudo chattr +i /home/domain/*/Desktop/*.desktop would work.

Re: The domain user usually deletes applications accidentally in the desktop!

Posted: Wed May 02, 2018 10:43 am
by ruyzz
Hello rene:

It only works when users are created, not when a new one is created when joining the domain.

There is a way to make it dynamic!

Re: The domain user usually deletes applications accidentally in the desktop!

Posted: Wed May 02, 2018 3:02 pm
by rene
Wasn't clear to me what the question entailed; the above reply would however still seem to to be the "Scripts & Bash" part of it? I take it now that you need some sort of trigger upon joining a domain: believe you may need to repost that part in the networking section. Personally precious little clue about Windows networking (and I do mean "precious").

Re: The domain user usually deletes applications accidentally in the desktop!

Posted: Fri May 04, 2018 10:26 am
by ruyzz
Thanks catweazel is the solution!

There will be some way to make it work when you start the session.

Re: The domain user usually deletes applications accidentally in the desktop!

Posted: Fri May 04, 2018 1:10 pm
by rene
Extremely misty thread. Only responded since I failed to notice a connection between the question and catweazel's reply -- and still do in fact. Shall however assume that "the solution" will indeed have some connection to "the question" though and thank you for reporting said solution :?

Re: The domain user usually deletes applications accidentally in the desktop!

Posted: Fri May 04, 2018 6:30 pm
by ruyzz
Hello:

This I wrote in the rc.local file:

chattr + i /home/domain/*/Desktop/*.desktop

exit 0

Re: The domain user usually deletes applications accidentally in the desktop!

Posted: Sat May 05, 2018 2:06 am
by catweazel
ruyzz wrote:
Fri May 04, 2018 10:26 am
Thanks catweazel
You're most welcome.