nuvious / pam-duress

A Pluggable Authentication Module (PAM) which allows the establishment of alternate passwords that can be used to perform actions to clear sensitive data, notify IT/Security staff, close off sensitive network connections, etc if a user is coerced into giving a threat actor a password.
GNU Lesser General Public License v3.0
1.33k stars 39 forks source link

Example Code May Not Work On Fresh Ubuntu Systems #35

Closed zakuArbor closed 2 years ago

zakuArbor commented 2 years ago

I installed a new image of Ubuntu to test the project and kept encountering an error where the code would not execute:

Jun 24 01:38:49 zaku pam_test: File is valid.
Jun 24 01:38:49 zaku pam_test: Processing /etc/duress.d.
Jun 24 01:38:49 zaku pam_test: Could not open directory /etc/duress.d, No such file or directory.
Jun 24 01:38:49 zaku pam_test: Executing /home/zaku/.duress/hello.sh.
Jun 24 01:38:49 zaku pam_test: Could not run script /home/zaku/.duress/hello.sh, Exec format error.

I resolved the issue by specifying on top of the shell script that it's a shell script

echo -e '#!/bin/sh\necho "Hello World"'
#!/bin/sh
echo "Hello World"

This is what we want to indicate that this is a shell script

zakuArbor commented 2 years ago

Dusan caught an error on my part. Refer to https://github.com/nuvious/pam-duress/pull/37#issuecomment-1167642181 for details but essentially I removed shellbang in the example wanting to keep the two PRs I requested separately but that was a bad idea.

nuvious commented 2 years ago

Dusan caught an error on my part. Refer to #37 (comment) for details but essentially I removed shellbang in the example wanting to keep the two PRs I requested separately but that was a bad idea.

Submitted for your review. I'll be doing a test on an ubuntu system today and putting up a screenshot sometime for the PR.

https://github.com/nuvious/pam-duress/pull/39