Revert "No ubuntu user, disallow root login, root shell on tty1"
This reverts commit 64e8cc5aacd60c748213ca891f5503d379d18786.
diff --git a/ubuntu-14.04/configs/cloud/cloud.cfg.d/99_tcp.cfg b/ubuntu-14.04/configs/cloud/cloud.cfg.d/99_tcp.cfg
index b2dd586..bfaa1fe 100644
--- a/ubuntu-14.04/configs/cloud/cloud.cfg.d/99_tcp.cfg
+++ b/ubuntu-14.04/configs/cloud/cloud.cfg.d/99_tcp.cfg
@@ -6,6 +6,14 @@
system_info:
# This will affect which distro class gets used
distro: ubuntu
+ # Default user name + that default users groups (if added/used)
+ default_user:
+ name: ubuntu
+ lock_passwd: True
+ gecos: Ubuntu
+ groups: [adm, audio, cdrom, dialout, dip, floppy, netdev, plugdev, sudo, video]
+ sudo: ["ALL=(ALL) NOPASSWD:ALL"]
+ shell: /bin/bash
# Other config here will be given to the distro class and/or path classes
paths:
cloud_dir: /var/lib/cloud/
diff --git a/ubuntu-14.04/http/preseed-lvm.cfg b/ubuntu-14.04/http/preseed-lvm.cfg
index c382581..528a577 100644
--- a/ubuntu-14.04/http/preseed-lvm.cfg
+++ b/ubuntu-14.04/http/preseed-lvm.cfg
@@ -60,9 +60,6 @@
d-i pkgsel/upgrade select none
d-i time/zone string UTC
-d-i passwd/root-login boolean true
-d-i passwd/make-user boolean false
-d-i openssh-server/permit-root-login boolean true
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false
tasksel tasksel/first multiselect minimal, ssh-server, openssh-server
diff --git a/ubuntu-14.04/http/preseed.cfg b/ubuntu-14.04/http/preseed.cfg
index 20d37d7..adb5924 100644
--- a/ubuntu-14.04/http/preseed.cfg
+++ b/ubuntu-14.04/http/preseed.cfg
@@ -26,9 +26,6 @@
d-i pkgsel/upgrade select none
d-i time/zone string UTC
-d-i passwd/root-login boolean true
-d-i passwd/make-user boolean false
-d-i openssh-server/permit-root-login boolean true
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false
tasksel tasksel/first multiselect minimal, ssh-server, openssh-server
diff --git a/ubuntu-14.04/scripts/base.sh b/ubuntu-14.04/scripts/base.sh
index 73af61c..43e6360 100644
--- a/ubuntu-14.04/scripts/base.sh
+++ b/ubuntu-14.04/scripts/base.sh
@@ -17,7 +17,7 @@
apt-get purge -y linux-image-* linux-headers-*
apt-get install -y linux-generic-lts-utopic
-apt-get -y autoremove --purge
+apt-get autoremove --purge
# Setup cloud-init
apt-get -y install cloud-init
diff --git a/ubuntu-14.04/scripts/cleanup.sh b/ubuntu-14.04/scripts/cleanup.sh
index 9793e9b..ae0b269 100644
--- a/ubuntu-14.04/scripts/cleanup.sh
+++ b/ubuntu-14.04/scripts/cleanup.sh
@@ -1,4 +1,4 @@
-apt-get -y autoremove --purge
+apt-get -y autoremove
apt-get -y clean
echo "cleaning up guest additions"
diff --git a/ubuntu-14.04/scripts/security.sh b/ubuntu-14.04/scripts/security.sh
deleted file mode 100644
index 7dd89b6..0000000
--- a/ubuntu-14.04/scripts/security.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-# Auto login root on tty1
-sed -i 's|/sbin/getty|/sbin/getty --autologin root|g' /etc/init/tty1.conf
-
-# Disable password root login
-usermod -p '!' root
-
-# Disable SSH password authentication and permit root login
-sed -i 's|[#]*PasswordAuthentication yes|PasswordAuthentication no|g' /etc/ssh/sshd_config
-sed -i 's|[#]*PermitRootLogin no|PermitRootLogin yes|g' /etc/ssh/sshd_config
diff --git a/ubuntu-14.04/template.json b/ubuntu-14.04/template.json
index 4a19baf..2f0dccb 100644
--- a/ubuntu-14.04/template.json
+++ b/ubuntu-14.04/template.json
@@ -1,7 +1,7 @@
{
"variables": {
- "user": "root",
- "password": "ho5uo7Uome5d",
+ "user": "{{ env `BUILD_USER` }}",
+ "password": "{{ env `BUILD_PASSWORD` }}",
"do_api_token": "{{ env `DO_API_TOKEN` }}",
"distro": "ubuntu-14-04-x64",
"disk_size": "8000"
@@ -18,7 +18,6 @@
"scripts/salt.sh",
"scripts/vagrant.sh",
"scripts/virtualbox.sh",
- "scripts/security.sh",
"scripts/cleanup.sh",
"scripts/zerodisk.sh"
]
@@ -28,7 +27,6 @@
"scripts/base.sh",
"scripts/salt.sh",
"scripts/vmware.sh",
- "scripts/security.sh",
"scripts/cleanup.sh",
"scripts/zerodisk.sh"
]
@@ -37,7 +35,6 @@
"scripts": [
"scripts/base.sh",
"scripts/salt.sh",
- "scripts/security.sh",
"scripts/cleanup.sh",
"scripts/zerodisk.sh"
]
@@ -46,7 +43,6 @@
"scripts": [
"scripts/base.sh",
"scripts/salt.sh",
- "scripts/security.sh",
"scripts/cleanup.sh"
]
}
@@ -96,8 +92,10 @@
" kbd-chooser/method=us<wait>",
" keyboard-configuration/layout=USA<wait>",
" keyboard-configuration/variant=USA<wait>",
- " passwd/root-password={{user `password`}} ",
- " passwd/root-password-again={{user `password`}} ",
+ " passwd/user-fullname={{user `user`}} ",
+ " passwd/user-password-again={{user `password`}} ",
+ " passwd/user-password={{user `password`}} ",
+ " passwd/username={{user `user`}} ",
" locale=en_US<wait>",
" netcfg/get_hostname=ubuntu-1404<wait>",
" netcfg/get_domain=cloudlab.cz<wait>",
@@ -142,8 +140,10 @@
" kbd-chooser/method=us<wait>",
" keyboard-configuration/layout=USA<wait>",
" keyboard-configuration/variant=USA<wait>",
- " passwd/root-password={{user `password`}} ",
- " passwd/root-password-again={{user `password`}} ",
+ " passwd/user-fullname={{user `user`}} ",
+ " passwd/user-password-again={{user `password`}} ",
+ " passwd/user-password={{user `password`}} ",
+ " passwd/username={{user `user`}} ",
" locale=en_US<wait>",
" netcfg/get_hostname=ubuntu-1404<wait>",
" netcfg/get_domain=changeme<wait>",
@@ -206,8 +206,10 @@
" kbd-chooser/method=us<wait>",
" keyboard-configuration/layout=USA<wait>",
" keyboard-configuration/variant=USA<wait>",
- " passwd/root-password={{user `password`}} ",
- " passwd/root-password-again={{user `password`}} ",
+ " passwd/user-fullname={{user `user`}} ",
+ " passwd/user-password-again={{user `password`}} ",
+ " passwd/user-password={{user `password`}} ",
+ " passwd/username={{user `user`}} ",
" locale=en_US<wait>",
" netcfg/get_hostname=ubuntu-1404<wait>",
" netcfg/get_domain=changeme<wait>",
@@ -217,7 +219,7 @@
"<enter><wait>"
]
},
- {
+ {
"type": "digitalocean",
"api_token": "{{user `do_api_token`}}",
"image": "{{user `distro`}}",