Last active
January 11, 2022 18:18
-
-
Save sylvainpelissier/836dbef8a8569162013a106803220802 to your computer and use it in GitHub Desktop.
eCryptFS Setup on Manjaro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo " eCryptFS Installation Script for Manjaro Linux " | |
echo " ---------------------------------------------- " | |
echo " This script will download and install the packages required to run eCryptFS and its utilities to encrypt a users home directory." | |
if [[ $EUID -ne 0 ]]; then | |
echo "" | |
echo " !! This script must be run as root !!" | |
echo " !! Exiting. !!" | |
echo "" | |
exit 1 | |
fi | |
echo " => Installing required pacman packages ..." | |
pacman -S ecryptfs-utils lsof rsync which | |
echo " => Setting up eCryptFS ... " | |
modprobe ecryptfs | |
cat > /etc/pam.d/system-auth <<EOF | |
#%PAM-1.0 | |
auth required pam_unix.so try_first_pass nullok | |
auth required pam_ecryptfs.so unwrap | |
auth optional pam_permit.so | |
auth required pam_env.so | |
account required pam_unix.so | |
account optional pam_permit.so | |
account required pam_time.so | |
password optional pam_ecryptfs.so | |
password required pam_unix.so try_first_pass nullok sha512 shadow | |
password optional pam_permit.so | |
session required pam_limits.so | |
session required pam_unix.so | |
session optional pam_ecryptfs.so unwrap | |
session optional pam_permit.so | |
EOF | |
echo " => Encrypting home directory ... " | |
echo -en " Enter username: " | |
read ENCRYPT_USER | |
echo " ===> Encrypting home directory for $ENCRYPT_USER" | |
ecryptfs-migrate-home -u $ENCRYPT_USER |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment