diff options
author | Feng Pan <fpan@redhat.com> | 2016-11-21 14:28:23 -0500 |
---|---|---|
committer | Feng Pan <fpan@redhat.com> | 2016-11-21 14:28:23 -0500 |
commit | 4cf6c5580ed386c070fcc72465b703f145e2ee9e (patch) | |
tree | d7c4e6204754879dc532bfa048990b763c3bb4dd | |
parent | f4a99172730e1ac6900b048e07a1146a8d14e52b (diff) |
puppet-fdio: add check for existance of ssh key before generating new one
Change-Id: I69fca1d480e2f89e059f29aeef681ae63e9796d3
Signed-off-by: Feng Pan <fpan@redhat.com>
-rw-r--r-- | jjb/puppet-fdio/puppet-fdio.yaml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/jjb/puppet-fdio/puppet-fdio.yaml b/jjb/puppet-fdio/puppet-fdio.yaml index 4f0de022c..d34f2c17d 100644 --- a/jjb/puppet-fdio/puppet-fdio.yaml +++ b/jjb/puppet-fdio/puppet-fdio.yaml @@ -143,7 +143,6 @@ name: allow-local-ssh-root builders: - shell: | - #!/bin/bash echo "" | sudo tee -a /etc/ssh/sshd_config echo "Match address 127.0.0.1" | sudo tee -a /etc/ssh/sshd_config echo " PermitRootLogin without-password" | sudo tee -a /etc/ssh/sshd_config @@ -151,7 +150,9 @@ echo "Match address ::1" | sudo tee -a /etc/ssh/sshd_config echo " PermitRootLogin without-password" | sudo tee -a /etc/ssh/sshd_config mkdir -p .ssh - ssh-keygen -f ~/.ssh/id_rsa -b 2048 -P "" + if [ ! -f ~/.ssh/id_rsa ]; then + ssh-keygen -f ~/.ssh/id_rsa -b 2048 -P "" + fi sudo mkdir -p /root/.ssh cat ~/.ssh/id_rsa.pub | sudo tee -a /root/.ssh/authorized_keys if [ -f /usr/bin/yum ]; then |