Last active
August 29, 2015 13:57
-
-
Save sukima/9458901 to your computer and use it in GitHub Desktop.
Allow user ssh authorized_keys access with ecryptfs hosts
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
realdir="/home/.ecryptfs/$USER/.ssh" | |
edir="$HOME/.ssh" | |
link_files=(authorized_keys authorized_keys2 authorized_hosts known_hosts) | |
mkdir -m 700 $realdir | |
for file in ${link_files[@]}; do | |
if [ -e $edir/$file ]; then | |
cp $edir/$file $realdir/$file | |
chmod 600 $realdir/$file | |
rm $edir/$file | |
fi | |
ln -s $realdir/$file $edir/$file | |
done | |
ecryptf-unmount-private | |
chmod 700 $HOME | |
mkdir -m 700 $edir | |
chmod 500 $HOME | |
for file in ${link_files[@]}; do | |
ln -s $realdir/$file $edir/$file | |
done | |
ecryptf-mount-private |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment