Skip to content

Commit 779763f

Browse files
ServiceToke4qqq
authored andcommitted
CLOUDSTACK-3054 - Have ssh key initscript handle SELinux permissions
1 parent 10e80af commit 779763f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

setup/bindir/cloud-set-guest-sshkey.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ fi
7171
homedir=$(grep ^$user /etc/passwd|awk -F ":" '{print $6}')
7272
sshdir=$homedir/.ssh
7373
authorized=$sshdir/authorized_keys
74+
restorecon=/sbin/restorecon
7475

7576

7677
if [ ! -e $sshdir ]
@@ -86,6 +87,10 @@ fi
8687
cat $authorized|grep -v "$publickey" > $authorized
8788
echo "$publickey" >> $authorized
8889

90+
if [ -e $restorecon ]
91+
then
92+
$restorecon -R -v $sshdir
93+
fi
8994

9095
exit 0
9196

0 commit comments

Comments
 (0)