summaryrefslogtreecommitdiff
path: root/google_compute_engine_oslogin/bin
diff options
context:
space:
mode:
authorRick Wright <rickw@google.com>2017-06-21 17:50:29 -0700
committerMax Illfelder <illfelder@users.noreply.github.com>2017-06-21 17:50:29 -0700
commit55747beba033ef8cdc9ef3be510d339f5f07bd25 (patch)
tree2fef0ad2448e460ef721a0d485482144f4b7f448 /google_compute_engine_oslogin/bin
parent0a63670c74f93a362369bff927d180d3d05ba090 (diff)
downloadgoogle-compute-image-packages-55747beba033ef8cdc9ef3be510d339f5f07bd25.tar.gz
Fix the OS Login RPM packaging. (#419)
Add SELinux settings and support for EL 6. Replace hardcoded /lib64 with ${_lib} and remove references to /usr/local/bin.
Diffstat (limited to 'google_compute_engine_oslogin/bin')
-rwxr-xr-xgoogle_compute_engine_oslogin/bin/google_oslogin_control11
1 files changed, 9 insertions, 2 deletions
diff --git a/google_compute_engine_oslogin/bin/google_oslogin_control b/google_compute_engine_oslogin/bin/google_oslogin_control
index bf95a55..0b98c40 100755
--- a/google_compute_engine_oslogin/bin/google_oslogin_control
+++ b/google_compute_engine_oslogin/bin/google_oslogin_control
@@ -17,7 +17,7 @@ script_name=$(basename "$0")
nss_config="/etc/nsswitch.conf"
pam_config="/etc/pam.d/sshd"
sshd_config="/etc/ssh/sshd_config"
-
+el_release_file="/etc/redhat-release"
usage() {
echo "Usage: ${script_name} {activate|deactivate} [--norestartsshd]"
@@ -34,7 +34,14 @@ pam_login="account requisite pam_oslogin_login.so"
pam_admin="account optional pam_oslogin_admin.so"
pam_homedir="session optional pam_mkhomedir.so"
-
+# Update AuthorizedKeysCommand to work on EL 6.
+if [ -f ${el_release_file} ]
+then
+ if grep -q "release 6" "/etc/redhat-release"
+ then
+ sshd_user="AuthorizedKeysCommandRunAs root"
+ fi
+fi
# User must be root to edit config files.
if [ $(id -u) -ne 0 ]