Skip to content

Commit

Permalink
Fancy dropbear 💄
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Aug 18, 2015
1 parent b1a75f4 commit 156a5f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions Linux/tree-armv7l/functions
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,12 @@ mount_nbd() {


start_sshd() {
mkdir -p /etc/dropbear /root/.ssh
chmod 700 /root/.ssh
dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
oc-metadata --cached | grep "SSH_PUBLIC_KEYS_.*_KEY" | cut -d'=' -f 2- | tr -d \' > /root/.ssh/authorized_keys
dropbear -d /etc/dropbear/dropbear_dss_host_key -r /etc/dropbear/dropbear_rsa_host_key
run mkdir -p /etc/dropbear /root/.ssh
run chmod 700 /root/.ssh
run dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key
run dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
run sh -ec "oc-metadata --cached | grep 'SSH_PUBLIC_KEYS_.*_KEY' | cut -d'=' -f 2- | tr -d \' > /root/.ssh/authorized_keys"
run dropbear -d /etc/dropbear/dropbear_dss_host_key -r /etc/dropbear/dropbear_rsa_host_key
}


Expand Down
10 changes: 5 additions & 5 deletions Linux/tree-armv7l/init
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,19 @@ if [ "$(get_any INITRD_DROPBEAR)" = "1" ]; then
log_success_msg "Starting a debug sshd"
start_sshd
log_end_msg
echo "**DEBUG DROPBEAR** (requested from the TAGS metadata of the server)"
echo "To continue the initrd process, just type 'echo 1 > /continue' from the ssh server"
ewarn "**DEBUG DROPBEAR** (requested from the TAGS metadata of the server)"
ewarn "To continue the initrd process, just type 'echo 1 > /continue' from the ssh server"
# FIXME: display ssh command and scw command
# FIXME: display common usages (luks, lvm, etc) in a README.txt file
mkfifo /continue
cat /continue
run mkfifo /continue
run cat /continue
else
log_end_msg
fi


# Ensure sshd is killed if running
killall dropbear &>/dev/null
run killall dropbear
# FIXME: if host keys don't exist in /newroot (first boot), we can copy the generated ones


Expand Down

0 comments on commit 156a5f1

Please sign in to comment.