Add SSH server to live macOS builds

This commit is contained in:
2Shirt 2021-04-01 22:59:31 -06:00
parent 7215c3242b
commit cdbc300ea2
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
2 changed files with 20 additions and 0 deletions

View file

@ -34,6 +34,17 @@ if ! [[ -e /Volumes/RAM_Disk/.wifi ]]; then
fi
fi
# Dropbear (SSH)
if ! [[ -d /Volumes/RAM_Disk/.ssh ]]; then
echo "Starting SSH server..."
mkdir /Volumes/RAM_Disk/.ssh
cp /.authorized_keys /Volumes/RAM_Disk/.ssh/authorized_keys
chown -R 0:0 /Volumes/RAM_Disk/.ssh
chmod 700 /Volumes/RAM_Disk/.ssh
chmod 600 /Volumes/RAM_Disk/.ssh/authorized_keys
dropbear -s
fi
# Stay awake
echo "Getting caffeinated..."
caffeinate -id &

View file

@ -58,6 +58,15 @@ cp -a /Library/Fonts/Inconsolata*ttf "${WK_PATH}/System/Library/Fonts"/
echo "Installing pipes.sh..."
cp -a /usr/bin/tput "${WK_PATH}/usr/bin"/
# Dropbear (SSH)
echo "Installing Dropbear..."
mkdir -p "${WK_PATH}/etc/dropbear"
for t in rsa dss ecdsa ed21559; do
dropbearkey -t "${t}" -f "${WK_PATH}/etc/dropbear_${t}_host_key"
done
ln -s /Volumes/RAM_Disk/.ssh "${WK_PATH}/var/root"/
cp -a ../linux/authorized_keys "${WK_PATH}/.authorized_keys"
# Terminal
echo "Installing Terminal Preferences..."
rsync -aS com.apple.Terminal.plist "${WK_PATH}/var/root/Library/Preferences"/