summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Berezovskiy <iberezovskiy@mirantis.com>2013-07-22 17:43:31 +0400
committerIvan Berezovskiy <iberezovskiy@mirantis.com>2013-07-25 17:14:56 +0400
commite1db99666cdfcb3a4fc69d4a5f039960cadb2f8e (patch)
tree40f297d6f944a9d7e4ea606ecfee48850735d928
parentc4ff43713b7279c83548005f242c8e7ef3c5aea7 (diff)
Setup password for root using variable 'DIB_PASSWORD'0.2.1.rc2
Move ssh configuration for root login into 'root-passwd' element. Fixes: bug #1199970 Change-Id: Iaac460394482651d8cb3d73dd924fcb600d3065c
Notes
Notes (review): Verified+2: Jenkins Approved+1: Sergey Lukjanov <slukjanov@mirantis.com> Code-Review+2: Sergey Lukjanov <slukjanov@mirantis.com> Code-Review+1: Alexander Ignatov <aignatov@mirantis.com> Code-Review+1: Matthew Farrellee <matt@redhat.com> Submitted-by: Jenkins Submitted-at: Thu, 25 Jul 2013 18:06:02 +0000 Reviewed-on: https://review.openstack.org/38149 Project: stackforge/savanna-extra Branch: refs/heads/master
-rwxr-xr-xelements/hadoop/post-install.d/30-setup-ssh2
-rwxr-xr-xelements/root-passwd/post-install.d/99-setup13
2 files changed, 10 insertions, 5 deletions
diff --git a/elements/hadoop/post-install.d/30-setup-ssh b/elements/hadoop/post-install.d/30-setup-ssh
index ae38321..d78a6ee 100755
--- a/elements/hadoop/post-install.d/30-setup-ssh
+++ b/elements/hadoop/post-install.d/30-setup-ssh
@@ -21,7 +21,6 @@ distro=$(lsb_release -is || :)
21echo $distro 21echo $distro
22case "$distro" in 22case "$distro" in
23 Ubuntu ) 23 Ubuntu )
24 augtool -s set /files/etc/ssh/sshd_config/PasswordAuthentication yes
25 augtool -s set /files/etc/ssh/sshd_config/GSSAPICleanupCredentials yes 24 augtool -s set /files/etc/ssh/sshd_config/GSSAPICleanupCredentials yes
26 augtool -s set /files/etc/ssh/sshd_config/AuthorizedKeysFile .ssh/authorized_keys 25 augtool -s set /files/etc/ssh/sshd_config/AuthorizedKeysFile .ssh/authorized_keys
27 ;; 26 ;;
@@ -29,7 +28,6 @@ case "$distro" in
29 sed -i 's/ssh_pwauth: 0/ssh_pwauth: 1/' /etc/cloud/cloud.cfg 28 sed -i 's/ssh_pwauth: 0/ssh_pwauth: 1/' /etc/cloud/cloud.cfg
30 augtool -s clear /files/etc/sudoers/Defaults[type=':nrpe']/requiretty/negate 29 augtool -s clear /files/etc/sudoers/Defaults[type=':nrpe']/requiretty/negate
31 augtool -s set /files/etc/ssh/sshd_config/SyslogFacility AUTH 30 augtool -s set /files/etc/ssh/sshd_config/SyslogFacility AUTH
32 augtool -s set /files/etc/ssh/sshd_config/PermitRootLogin yes
33 augtool -s set /files/etc/ssh/sshd_config/StrictModes yes 31 augtool -s set /files/etc/ssh/sshd_config/StrictModes yes
34 augtool -s set /files/etc/ssh/sshd_config/RSAAuthentication yes 32 augtool -s set /files/etc/ssh/sshd_config/RSAAuthentication yes
35 augtool -s set /files/etc/ssh/sshd_config/PubkeyAuthentication yes 33 augtool -s set /files/etc/ssh/sshd_config/PubkeyAuthentication yes
diff --git a/elements/root-passwd/post-install.d/99-setup b/elements/root-passwd/post-install.d/99-setup
index f0cd7fc..3ef8d92 100755
--- a/elements/root-passwd/post-install.d/99-setup
+++ b/elements/root-passwd/post-install.d/99-setup
@@ -1,4 +1,11 @@
1#!/bin/bash 1#!/bin/bash
2echo "Setting up root password" 2if [ -z "$DIB_PASSWORD" ]; then
3echo -e "swordfish\nswordfish\n" | passwd 3 echo "Error during setup password for root"
4 4 exit 1
5fi
6sed -i "s/disable_root: true/disable_root: false/" /etc/cloud/cloud.cfg
7install-packages augeas-tools openssh-server openssh-client
8augtool -s set /files/etc/ssh/sshd_config/PasswordAuthentication yes
9augtool -s set /files/etc/ssh/sshd_config/PermitRootLogin yes
10augtool -s set /files/etc/ssh/ssh_config/PasswordAuthentication yes
11echo -e "$DIB_PASSWORD\n$DIB_PASSWORD\n" | passwd