Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed lost-authorized-keys problem
  • Loading branch information
Abhi Hiremagalur and Brian Cunnie committed Apr 12, 2013
1 parent c89a374 commit 3da31ff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion 1_reset_machine.rb
Expand Up @@ -49,7 +49,10 @@ def find_partition(name)
puts "turning off spotlight on /Volumes/NEWLY_IMAGED"
system!("ssh #{image_user_at_host} 'sudo mdutil -i off /Volumes/NEWLY_IMAGED'")
puts "putting ssh-keys into place"
system!("ssh #{image_user_at_host} 'cp -Rp .ssh /Volumes/NEWLY_IMAGED/Users/#{image_user}/bootstrap_ssh'")
system!("ssh #{image_user_at_host} 'mkdir /Volumes/NEWLY_IMAGED/Users/#{image_user}/.ssh'")
system!("ssh #{image_user_at_host} 'chmod 700 /Volumes/NEWLY_IMAGED/Users/#{image_user}/.ssh'")
system!("ssh #{image_user_at_host} 'cp -s .ssh/id_github_lion /Volumes/NEWLY_IMAGED/Users/#{image_user}/.ssh'")
system!("ssh #{image_user_at_host} 'cp -s .ssh/authorized_keys /Volumes/NEWLY_IMAGED/Users/#{image_user}/.ssh'")
puts "now putting sudoers that doesn't ask for a password"
system!("ssh #{image_user_at_host} 'sudo cp {,/Volumes/NEWLY_IMAGED}/private/etc/sudoers'")
puts "turn on sshd"
Expand Down
6 changes: 3 additions & 3 deletions 2_run_soloist.sh
Expand Up @@ -8,7 +8,7 @@ ssh $IMAGE_USER@$IMAGE_HOST "

if [[ $PIVOTAL_LABS ]]; then
ssh $IMAGE_USER@$IMAGE_HOST 'eval `ssh-agent` &&
ssh-add ~/bootstrap_ssh/id_github_lion &&
ssh-add ~/.ssh/id_github_lion &&
( ssh -o StrictHostKeyChecking=no git@github.com exit; : ) &&
cd /tmp &&
git clone git@github.com:pivotalprivate/pivotal_workstation_private.git &&
Expand All @@ -25,7 +25,7 @@ if [[ $PIVOTAL_LABS ]]; then

# Successful run, let's do the tagging, etc...
ssh $IMAGE_USER@$IMAGE_HOST 'eval `ssh-agent` &&
ssh-add ~/bootstrap_ssh/id_github_lion &&
ssh-add ~/.ssh/id_github_lion &&
pushd /tmp/sprout-wrap/cookbooks/pivotal_workstation &&
git remote set-url origin git@github.com:pivotal/pivotal_workstation.git
git tag success/`date +%Y%m%d%H%M%S` &&
Expand Down Expand Up @@ -60,4 +60,4 @@ true'

# reboot to Persistent
ssh $IMAGE_USER@$IMAGE_HOST 'sudo bless --mount /Volumes/Persistent --setboot'
ssh $IMAGE_USER@$IMAGE_HOST 'rm -fr ~/bootstrap_ssh; sudo shutdown -r now'
ssh $IMAGE_USER@$IMAGE_HOST 'rm -fr ~/.ssh/id_github_lion ~/.ssh/authorized_keys && sudo shutdown -r now'

0 comments on commit 3da31ff

Please sign in to comment.