diff options
| author | Natanael Copa <ncopa@alpinelinux.org> | 2018-06-12 20:17:41 +0000 |
|---|---|---|
| committer | Natanael Copa <ncopa@alpinelinux.org> | 2018-06-12 20:21:13 +0000 |
| commit | 4ef156921798938fbfe943ff16edf1d5afee9484 (patch) | |
| tree | ebbcae9c072f510b1a5d93c1f0a56020df5374de /main/openrc/firstboot.initd | |
| parent | 98aba77e80c763faccc04378ff489e3e7ebc1f1a (diff) | |
| download | aports-4ef156921798938fbfe943ff16edf1d5afee9484.tar.bz2 aports-4ef156921798938fbfe943ff16edf1d5afee9484.tar.xz | |
main/openrc: misc fixes for firstboot
- disable ssh_pass option
- sshd service is enabled form initramfs so remove depends
- remove firstboot from all runlevels. This should only run once
- remove http and ftp support. Require https.
Diffstat (limited to 'main/openrc/firstboot.initd')
| -rw-r--r-- | main/openrc/firstboot.initd | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/main/openrc/firstboot.initd b/main/openrc/firstboot.initd index cc888b351f..4c26a815c8 100644 --- a/main/openrc/firstboot.initd +++ b/main/openrc/firstboot.initd @@ -12,15 +12,8 @@ init_KOPT() { done } -depend() { - keyword -vserver -lxc - init_KOPT - [ -n "$KOPT_ssh_key" ] && need sshd - [ -n "$KOPT_ssh_pass" ] && use sshd -} - - start() { + rm -f /etc/runlevels/*/$RC_SVCNAME init_KOPT local rc=0 ebegin "Starting ${RC_SVCNAME}" @@ -28,17 +21,13 @@ start() { einfo "Fetching ssh keys" mkdir -pm 700 /root/.ssh case "$KOPT_ssh_key" in - http://*|https://*|ftp://*|ftps://*) + https://*|ftps://*) wget -q "$KOPT_ssh_key" -O /root/.ssh/authorized_keys rc=$?;; *) echo "$KOPT_ssh_key" > /root/.ssh/authorized_keys;; esac chmod 600 /root/.ssh/authorized_keys fi - if [ -n "$KOPT_ssh_pass" ]; then - echo "root:$KOPT_ssh_pass" | /usr/sbin/chpasswd - command_args="-o PermitRootLogin=yes" rc-service sshd start --quiet - fi eend $rc } |
