How to autorun bash script with utility accounts as root?

there is a very simple script bach. It is registered to run the RDP and the command init 0 which extinguishes the computer when you exit RDP. As root everything works, and RDP is started and at the end of the session the computer goes out, when run as user upon completion of a session, the computer is not extinguished. Question - how to start a script under user accounts but with the rights root to init 0 worked ?
@reboot /bin/1.bash in crontab prescribed (no use)

All Linuksoidam thanks in advance. Really need
June 3rd 19 at 19:33
3 answers
June 3rd 19 at 19:35
sudo
Dear, can write details? - jabari_Fadel commented on June 3rd 19 at 19:38
,
sudo 'your script'
or to commands that are written in the script, add sudo
accordingly, you should be in the sudo group
for example
#!/bin/bash
sudo mate-terminal-t HTOP -e htop'

written in the script = start terminal as root,
and then it start htop - kareem_Kohler41 commented on June 3rd 19 at 19:41
i.e. after the line #!/bin/bash I just prescribe sudo mate-terminal-t HTOP -e htop' before calling RDP and init ? - jabari_Fadel commented on June 3rd 19 at 19:44
,
no,of course,
I just gave an example
script show,it will be easier to explain - kareem_Kohler41 commented on June 3rd 19 at 19:47
#! /bin/bash
xfreerdp --sec rdp 10.10.10.10
init 0 - jabari_Fadel commented on June 3rd 19 at 19:50
June 3rd 19 at 19:37
June 3rd 19 at 19:39
how to start a script under user accounts but with the rights root to init 0 worked ?

No way.

You need to:
- man sudo
- change formulation of the problem
- new script
- if something went wrong, go to step 1
when I give the user root it works. I think it should be a decision..... - jabari_Fadel commented on June 3rd 19 at 19:42
of course. Ruth just ignores the system of rights. The word really. For example it can read the file with the rights of 0000 and not in the least surprised that he can perehodit in the directory with the rights of 0000.

Not system Your to You to fix :) I only give advice, as is common in such cases. - kareem_Kohler41 commented on June 3rd 19 at 19:45
the problem is that I'm familiar with Linux, second week..... ))) - jabari_Fadel commented on June 3rd 19 at 19:48
It just is not a problem :) - kareem_Kohler41 commented on June 3rd 19 at 19:51

Find more questions by tags bash