mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-02 09:10:11 +02:00
install Vagrant insecure_private_key into buildserver box
Vagrant uses the "insecure private key" to establish the first SSH connection to a new VM based on a clean public box. In theory, the `vagrant package` command should do that automatically. This process is still using custom code instead of `vagrant package`, hence this script. This public key can be generated on any Vagrant install using: ssh-keygen -y -f ~/.vagrant.d/insecure_private_key https://www.vagrantup.com/docs/vagrantfile/ssh_settings#config-ssh-private_key_path fdroid-bootstrap-buildserver#12 !1012 !1099
This commit is contained in:
parent
046d3c8dcf
commit
c6f5956537
2
buildserver/Vagrantfile
vendored
2
buildserver/Vagrantfile
vendored
@ -77,6 +77,8 @@ Vagrant.configure("2") do |config|
|
||||
owner: 'root', group: 'root', create: true
|
||||
end
|
||||
|
||||
config.vm.provision "shell", name: "vagrant-insecure-private-key",
|
||||
path: "provision-vagrant-insecure-private-key"
|
||||
config.vm.provision "shell", name: "setup-env-vars", path: "setup-env-vars",
|
||||
args: ["/opt/android-sdk"]
|
||||
config.vm.provision "shell", name: "apt-get-install", path: "provision-apt-get-install",
|
||||
|
17
buildserver/provision-vagrant-insecure-private-key
Executable file
17
buildserver/provision-vagrant-insecure-private-key
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash -e
|
||||
#
|
||||
# Vagrant uses the "insecure private key" to establish the first SSH
|
||||
# connection to a new VM based on a clean public box. In theory, the
|
||||
# `vagrant package` command should do that automatically. This
|
||||
# process is still using custom code instead of `vagrant package`,
|
||||
# hence this script.
|
||||
#
|
||||
# https://gitlab.com/fdroid/fdroid-bootstrap-buildserver/-/issues/12
|
||||
# https://www.vagrantup.com/docs/vagrantfile/ssh_settings#config-ssh-private_key_path
|
||||
#
|
||||
# This public key can be generated using:
|
||||
# ssh-keygen -y -f ~/.vagrant.d/insecure_private_key
|
||||
|
||||
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== ~/.vagrant.d/insecure_private_key" > /home/vagrant/.ssh/authorized_keys
|
||||
chown vagrant:vagrant /home/vagrant/.ssh/authorized_keys
|
||||
chmod 600 /home/vagrant/.ssh/authorized_keys
|
Loading…
Reference in New Issue
Block a user