summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extras/peer_add_secret_pub.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/extras/peer_add_secret_pub.in b/extras/peer_add_secret_pub.in
index e3a9aa2a48b..c9674af353d 100644
--- a/extras/peer_add_secret_pub.in
+++ b/extras/peer_add_secret_pub.in
@@ -53,6 +53,13 @@ if [ ! -d $authorized_keys_file ]; then
chown $user: $authorized_keys_file;
fi
+# Restore SELinux security contexts. This is required
+# for passwdless SSH to work.
+
+if type restorecon >/dev/null 2>&1; then
+ restorecon -F $ssh_dir $authorized_keys_file;
+fi
+
# Add to authorized_keys file only if not exists already
while read line
do