Molly-guard doesn't work


from my Manjaro I administrate my Rasperry Pis. Unfortunately it already happened that I accidentally restarted my local system instead of the remote system.
Under Debian/Ubuntu or Raspbian molly-guard works very well.

Unfortunately, molly-guard doesn’t seem to work locally on my Manjaro, even though I changed the config:

cat /etc/molly-guard/rc
# molly-guard settings
# when set, causes the 30-query-hostname script to always ask for the
# hostname, even if no SSH session was detected.

# when set, causes the 30-query-hostname script to ask for the fully-qualified
# hostname, rather than the short name

sudo reboot

is performed after the sudo password prompt without asking for the hostname.

What am I doing wrong?

Do I perhaps have a way elsewhere to set up the reboot of my machine via the console with a security prompt?


I have already tested it with Manjaro XFCE and Manjaro KDE, with the same result.

Did you read and proceed this after installation?

1 Like


thank you very much. No, I have not seen this hint yet.
How do I have to apply this?

user$ source "/etc/profile.d/"
user$ sudo reboot

reboot without asking for the hostname

user$ sudo source "/etc/profile.d/"
sudo: source: command not found

Maybe you can help me with this?

thanks and greetings

Gosh… this guard works with aliases. These aliases written in /etc/profile.d/ and gets loaded after every login.

source "/etc/profile.d/" is only needed if you need it instantly without re-log/reboot.

Simply don’t use sudo here? As I see it replaces: halt poweroff reboot shutdown, but not sudo. It is not needed here. Or add like mentioned an alias: alias sudo="sudo "

Hello Megavolt,

unfortunately, I don’t quite understand it. Why is it not clearly described in the documentation what must be done?
I did a little “try and error” At the end I have the following lines in my


# molly-guard
source "/etc/profile.d/"
alias sudo='sudo '

If i type

sudo reboot

it asks for the hostname and (the most important) if I cancel this security question, my local manjaro will not reboot either.


Thanks for your patience.

Because molly-guard is just a simple helper script, just like for example manjaro-chroot. It is just a helper to setup such a simple guard. You can do it also without it pretty easy, just write some functions and add aliase, thats it.

The only source I found is the one from debian, so I conclude it is made with debian in mind, just like manjaro-chroot is made with manjaro in mind.

It is pretty much this script: File: | Debian Sources 126 lines of code. I don’t understand why you need to use exactly this, but well, everyone has different habits.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.