implement enablessh()

This commit is contained in:
parazyd 2016-10-12 21:24:55 +02:00
parent 2ea6563962
commit 6813aa0b3d
No known key found for this signature in database
GPG Key ID: F0CB28FCF78637DE
1 changed files with 17 additions and 0 deletions

View File

@ -121,6 +121,23 @@ EOF
sudo -E chroot $werdo /dpkgdivert || zerr
}
enablessh() {
fn enablessh
req=(strapdir)
ckreq || return 1
cat <<EOF | sudo tee -a ${strapdir}/enssh
#!/bin/sh
sed -i -e 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
update-rc.d ssh enable
EOF
dpkgdivert on $strapdir
sudo chmod +x $strapdir/enssh
sudo -E chroot $strapdir /enssh
dpkgdivert off $strapdir
}
silly() {
fn silly "$@"
local arg1="$1"