Paranoia
This commit is contained in:
parent
b9c4569b6b
commit
efa8fc2b0a
|
@ -91,6 +91,7 @@ mkdir -m 01777 -p /tmp
|
||||||
mkdir -m 0755 -p /var /var/log /var/lib /var/db
|
mkdir -m 0755 -p /var /var/log /var/lib /var/db
|
||||||
mkdir -m 0755 -p /nix/var
|
mkdir -m 0755 -p /nix/var
|
||||||
mkdir -m 0700 -p /root
|
mkdir -m 0700 -p /root
|
||||||
|
chmod 0700 /root
|
||||||
mkdir -m 0755 -p /bin # for the /bin/sh symlink
|
mkdir -m 0755 -p /bin # for the /bin/sh symlink
|
||||||
mkdir -m 0755 -p /home
|
mkdir -m 0755 -p /home
|
||||||
mkdir -m 0755 -p /etc/nixos
|
mkdir -m 0755 -p /etc/nixos
|
||||||
|
|
|
@ -44,7 +44,7 @@ with lib;
|
||||||
# into the image (a Nova feature).
|
# into the image (a Nova feature).
|
||||||
if ! [ -e /root/.ssh/authorized_keys ]; then
|
if ! [ -e /root/.ssh/authorized_keys ]; then
|
||||||
echo "obtaining SSH key..."
|
echo "obtaining SSH key..."
|
||||||
mkdir -p /root/.ssh
|
mkdir -m 0700 -p /root/.ssh
|
||||||
$wget http://169.254.169.254/1.0/meta-data/public-keys/0/openssh-key > /root/key.pub
|
$wget http://169.254.169.254/1.0/meta-data/public-keys/0/openssh-key > /root/key.pub
|
||||||
if [ $? -eq 0 -a -e /root/key.pub ]; then
|
if [ $? -eq 0 -a -e /root/key.pub ]; then
|
||||||
if ! grep -q -f /root/key.pub /root/.ssh/authorized_keys; then
|
if ! grep -q -f /root/key.pub /root/.ssh/authorized_keys; then
|
||||||
|
|
|
@ -139,7 +139,7 @@ in
|
||||||
# Don't download the SSH key if it has already been downloaded
|
# Don't download the SSH key if it has already been downloaded
|
||||||
if ! [ -e /root/.ssh/authorized_keys ]; then
|
if ! [ -e /root/.ssh/authorized_keys ]; then
|
||||||
echo "obtaining SSH key..."
|
echo "obtaining SSH key..."
|
||||||
mkdir -p /root/.ssh
|
mkdir -m 0700 -p /root/.ssh
|
||||||
${wget} -O /root/authorized-keys-metadata http://metadata/0.1/meta-data/authorized-keys
|
${wget} -O /root/authorized-keys-metadata http://metadata/0.1/meta-data/authorized-keys
|
||||||
if [ $? -eq 0 -a -e /root/authorized-keys-metadata ]; then
|
if [ $? -eq 0 -a -e /root/authorized-keys-metadata ]; then
|
||||||
cat /root/authorized-keys-metadata | cut -d: -f2- > /root/key.pub
|
cat /root/authorized-keys-metadata | cut -d: -f2- > /root/key.pub
|
||||||
|
|
|
@ -190,6 +190,9 @@ let
|
||||||
|
|
||||||
$machine->succeed("test -e /boot/grub");
|
$machine->succeed("test -e /boot/grub");
|
||||||
|
|
||||||
|
# Check whether /root has correct permissions.
|
||||||
|
$machine->succeed("stat -c '%a' /root") =~ /700/ or die;
|
||||||
|
|
||||||
# Did the swap device get activated?
|
# Did the swap device get activated?
|
||||||
# uncomment once https://bugs.freedesktop.org/show_bug.cgi?id=86930 is resolved
|
# uncomment once https://bugs.freedesktop.org/show_bug.cgi?id=86930 is resolved
|
||||||
#$machine->waitForUnit("swap.target");
|
#$machine->waitForUnit("swap.target");
|
||||||
|
|
Loading…
Reference in New Issue