Skip to content

Instantly share code, notes, and snippets.

@calerogers
Created September 17, 2016 22:17
Show Gist options
  • Select an option

  • Save calerogers/0587d3795814a8bf0068f871dff12025 to your computer and use it in GitHub Desktop.

Select an option

Save calerogers/0587d3795814a8bf0068f871dff12025 to your computer and use it in GitHub Desktop.
## Options to set on the command line
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
d-i netcfg/disable_autoconfig boolean false
d-i netcfg/choose_interface select auto
d-i base-installer/kernel/override-image string linux-server
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true
d-i time/zone string US/Pacific
d-i clock-setup/ntp boolean true
d-i mirror/country string US
d-i mirror/http/proxy string
d-i mirror/http/mirror select ftp.ubuntu.com
d-i pkgsel/install-language-support boolean false
d-i pkgsel/update-policy select none
tasksel tasksel/first multiselect none
d-i pkgsel/include string openssh-server gcc make vim libglu1-mesa libxi-dev libxmu-dev python-pip python-dev
d-i pkgsel/upgrade select none
d-i partman-auto/method string regular
partman-auto/expert_recipe string \
boot-root :: \
40 50 100 ext4 \
$primary{ } $bootable{ } \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ /boot } \
. \
500 10000 1000000000 ext4 \
method{ format } format{ } \
use_filesystem{ } filesystem{ ext4 } \
mountpoint{ / } \
. \
64 512 100% linux-swap \
method{ swap } format{ } \
.
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm boolean true
##### Setting up root user #####
d-i passwd/root-login boolean true
d-i passwd/make-user boolean false
d-i passwd/root-password password thePassword
d-i passwd/root-password-again password thePassword
d-i user-setup/encrypt-home boolean false
# To allow root login with password, which isn't the best but needed for my use case
d-i preseed/late_command string \
in-target sed -i 's/PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
##### To create a normal user account #####
#d-i passwd/user-fullname string User Name
#d-i passwd/username string username
#d-i passwd/user-password password thePassword
#d-i passwd/user-password-again password thePassword
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i finish-install/reboot_in_progress note
@adamwbb
Copy link

adamwbb commented Jul 18, 2019

d-i preseed/late_command string
in-target sed -i 's/PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config

this may change the value to yes in the sshd_config but it still leaves the line commented out still requiring manual editing of the file to enable access to ssh as root.

@mdurell
Copy link

mdurell commented Sep 19, 2019

d-i preseed/late_command string
in-target sed -i 's/PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config

this may change the value to yes in the sshd_config but it still leaves the line commented out still requiring manual editing of the file to enable access to ssh as root.

Try this instead:

d-i preseed/late_command string \
     in-target sed -i 's/^.*PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config

The '^.*' should match anything (or nothing) that might fall between the start of the line and 'PermitRootLogin'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment