From 779763fdfd34c00f19481d88c6cccb1edf8bf532 Mon Sep 17 00:00:00 2001 From: Ian Service Date: Tue, 18 Jun 2013 10:39:31 -0400 Subject: [PATCH] CLOUDSTACK-3054 - Have ssh key initscript handle SELinux permissions --- setup/bindir/cloud-set-guest-sshkey.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup/bindir/cloud-set-guest-sshkey.in b/setup/bindir/cloud-set-guest-sshkey.in index 15008b8d514..f3f02b15fb0 100755 --- a/setup/bindir/cloud-set-guest-sshkey.in +++ b/setup/bindir/cloud-set-guest-sshkey.in @@ -71,6 +71,7 @@ fi homedir=$(grep ^$user /etc/passwd|awk -F ":" '{print $6}') sshdir=$homedir/.ssh authorized=$sshdir/authorized_keys +restorecon=/sbin/restorecon if [ ! -e $sshdir ] @@ -86,6 +87,10 @@ fi cat $authorized|grep -v "$publickey" > $authorized echo "$publickey" >> $authorized +if [ -e $restorecon ] +then + $restorecon -R -v $sshdir +fi exit 0