Fix wrong path in ssh selinux issue detection.
I also make sure that if grep fail it doesn't make the whole installation fails. Change-Id: Ib5873383632a1141c8dd3859b34ca29904020790 Closes-Bug: #1736246
This commit is contained in:
parent
758e8caee0
commit
3bea7d156d
|
@ -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/
|
||||
|
|
Loading…
Reference in New Issue