Merge "Fix wrong path in ssh selinux issue detection."

This commit is contained in:
Zuul 2017-12-06 22:53:36 +00:00 committed by Gerrit Code Review
commit 2f133c41e6
1 changed files with 3 additions and 1 deletions

View File

@ -27,7 +27,9 @@ cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
if [ -e /usr/sbin/getenforce ]; then
if [ "$(getenforce)" == "Enforcing" ]; then
selinux_wrong_permission="$(find /home/.ssh/ -exec ls -lZ {} \; | grep -v 'ssh_home_t')"
set +x
selinux_wrong_permission="$(find /root/.ssh/ -exec ls -lZ {} \; | grep -v 'ssh_home_t')"
set -x
if [ -n "${selinux_wrong_permission}" ]; then
semanage fcontext -a -t ssh_home_t '/root/.ssh(/.*)?'
restorecon -R /root/.ssh/