CLOUDSTACK-1340: Fix typos, paths, create user cloud and make 'em invincible

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2013-02-27 18:24:50 +05:30
parent 82d00c5fd1
commit a5ab63602d
5 changed files with 23 additions and 13 deletions

View File

@ -6,8 +6,8 @@ apt-get -y update
apt-get -y install curl unzip
apt-get clean
# Set up sudo
echo 'vagrant ALL=NOPASSWD:ALL' > /etc/sudoers.d/vagrant
# Set up sudo, TODO: Check security concerns
echo 'cloud ALL=NOPASSWD:ALL' > /etc/sudoers.d/cloud
# Tweak sshd to prevent DNS resolution (speed up logins)
echo 'UseDNS no' >> /etc/ssh/sshd_config

View File

@ -18,5 +18,3 @@ rm /lib/udev/rules.d/75-persistent-net-generator.rules
echo "Adding a 2 sec delay to the interface up, to make the dhclient happy"
echo "pre-up sleep 2" >> /etc/network/interfaces
# Remove the vagrant user
deluser --group --force -remove-home vagrant

View File

@ -68,8 +68,14 @@ install_packages() {
setup_accounts() {
# Setup sudo to allow no-password sudo for "admin"
groupadd -r admin
# Create a 'cloud' user
useradd -G admin cloud
# Create a 'cloud' user if it's not there
id cloud
if [[ $? -ne 0 ]]
then
useradd -G admin cloud
else
usermod -a -G admin cloud
fi
echo "root:$ROOTPW" | chpasswd
echo "cloud:`openssl rand -base64 32`" | chpasswd
sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
@ -156,8 +162,11 @@ configure_services() {
cp -rv $snapshot_dir/patches/systemvm/debian/config/* /
cp -rv $snapshot_dir/patches/systemvm/debian/vpn/* /
mkdir -p /usr/share/cloud/
tar -cvf /usr/share/cloud/cloud-scripts.tar $snapshot_dir/patches/systemvm/debian/config/*
tar -rvf /usr/share/cloud/cloud-scripts.tar $snapshot_dir/patches/systemvm/debian/vpn/*
cd $snapshot_dir/patches/systemvm/debian/config
tar -cvf /usr/share/cloud/cloud-scripts.tar *
cd $snapshot_dir/patches/systemvm/debian/vpn
tar -rvf /usr/share/cloud/cloud-scripts.tar *
cd /opt
rm -fr $snapshot_dir cloudstack.tar.gz
chkconfig --add cloud-early-config

View File

@ -223,11 +223,11 @@ d-i passwd/root-password-again password password
#d-i passwd/root-password-crypted password [MD5 hash]
# To create a normal user account.
d-i passwd/user-fullname string Vagrant User
d-i passwd/username string vagrant
d-i passwd/user-fullname string Cloud Stack
d-i passwd/username string cloud
# Normal user's password, either in clear text
d-i passwd/user-password password vagrant
d-i passwd/user-password-again password vagrant
d-i passwd/user-password password cloud
d-i passwd/user-password-again password cloud
# or encrypted using an MD5 hash.
#d-i passwd/user-password-crypted password [MD5 hash]
# Create the first user with the specified UID instead of the default.

View File

@ -1,10 +1,13 @@
# Clean up stuff copied in by veewee
rm -f /root/*
echo "Cleaning up"
# Zero out the free space to save space in the final image:
for path in / /boot /usr /var /opt /tmp
do
dd if=/dev/zero of=$path/zero bs=1M
sync
rm -f $i/zero
rm -f $path/zero
echo "Completed zero-ing out disk on $path"
done