-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
81 lines (53 loc) · 2.87 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
README (Inhibit)
Project
Inhibit
Version 1.4.1
Copyright (c) 2024 by Ralf Kilian
GitHub: https://github.com/urbanware-org/inhibit
GitLab: https://gitlab.com/urbanware-org/inhibit
Definition
The Inhibit project is a tool to prevent accidental execution of
critical commands, e.g. to shutdown or reboot the system by prompting
the user to enter its hostname.
License
This project is distributed under the MIT License. You should have
received a copy of the license along with this program (see 'LICENSE'
file). If not, you can find the license terms here:
https://opensource.org/licenses/MIT
Usage
Now, to e.g. prevent the accidental execution of the 'shutdown',
'poweroff', 'halt' and 'reboot' commands, add the following lines
either to '/etc/bashrc' (system wide) or '~/.bashrc' (for the current
user, only).
In the following examples 'inhibit.sh' is located in '/opt/inhibit'.
# Prevent certain commands to shutdown the system in any way
alias halt='/opt/inhibit/inhibit.sh halt'
alias poweroff='/opt/inhibit/inhibit.sh poweroff'
alias reboot='/opt/inhibit/inhibit.sh reboot'
alias shutdown='/opt/inhibit/inhibit.sh shutdown'
You can also give command-line arguments for the inhibited command,
for example:
alias poweroff='/opt/inhibit/inhibit.sh poweroff -f'
It is also possible to also inhibit commands for services controlled
by 'systemctl'.
alias systemctl='/opt/inhibit/inhibit.sh systemctl'
Notice that this alias will have no effect unless you explicitly add
the name of the service (or services) which should be confirmed to the
service list inside 'inhibit.conf'. Details can be found inside that
file.
After adding the preferred aliases, you can apply the changes either
by logging out and in again or by reloading the '.bashrc' file of the
current user (depending on in which file you have added the aliases).
$ source ~/.bashrc
Now, if you want to execute one of those commands for which you have
set up (created aliases for) Inhibit, you will explicitly have to
confirm their execution.
Contact
Any suggestions, questions, bugs to report or feedback to give? If so,
you can find the contact information inside the 'CONTACT' file.
Legal information
The project name is completely fictitious. Any correspondences with
existing websites, applications, companies and/or other projects are
purely coincidental.
All trademarks belong to their respective owners.
Errors and omissions excepted.