Sha256: 20d41d02c2842cf375b80d4611532b077194fbffb20553134cd57b4736b78901

Contents?: true

Size: 1.52 KB

Versions: 5

Compression:

Stored size: 1.52 KB

Contents

#!/bin/bash
source /etc/profile

# add default users and groups, setpasswords, configure privileges and install sudo
# PREREQUISITE: virtualbox guest additions - need the vboxguest group to exist
mkdir -p "$chroot/home/vagrant/.ssh"
chmod 700 "$chroot/home/vagrant/.ssh"
wget --no-check-certificate "$vagrant_ssh_key_url" -O "$chroot/home/vagrant/.ssh/authorized_keys"
chmod 600 "$chroot/home/vagrant/.ssh/authorized_keys"
cp -f /root/.vbox_version "$chroot/home/vagrant/.vbox_version"

# for passwordless logins
mkdir -p "$chroot/root/.ssh" 2> /dev/null
cat /tmp/ssh-root.pub >> "$chroot/root/.ssh/authorized_keys"

# add vagrant user
chroot $chroot /bin/bash <<DATAEOF
groupadd -r vagrant
useradd -m -r vagrant -g vagrant -G wheel,vboxsf,vboxguest -c 'added by vagrant, veewee basebox creation'

# set passwords (for after reboot)
passwd<<EOF
$password_root
$password_root
EOF

passwd vagrant<<EOF
$password_vagrant
$password_vagrant
EOF

# to each its own... home
chown -R vagrant /home/vagrant

emerge app-admin/sudo

echo 'sshd:ALL' > /etc/hosts.allow
echo 'ALL:ALL' > /etc/hosts.deny
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
DATAEOF

# configure ssh daemon
# veewee validate uses password authentication, so we have to enable it
cat <<DATAEOF > "$chroot/etc/ssh/sshd_config"
HostBasedAuthentication no
IgnoreUserKnownHosts yes
PasswordAuthentication yes
PermitRootLogin yes
PermitUserEnvironment no
PrintLastLog no
PrintMotd no
PubKeyAuthentication yes
Subsystem sftp internal-sftp
UseDNS no
UsePAM yes
UsePrivilegeSeparation sandbox
DATAEOF

Version data entries

5 entries across 3 versions & 2 rubygems

Version Path
veewee-0.3.10 templates/gentoo-latest-i686/vagrant.sh
veewee-0.3.9 templates/gentoo-latest-amd64/vagrant.sh
veewee-0.3.9 templates/gentoo-latest-i686/vagrant.sh
veewee-atlassian-0.3.11 templates/gentoo-latest-i686-experimental/vagrant.sh
veewee-atlassian-0.3.11 templates/gentoo-latest-x86_64-experimental/vagrant.sh