From 0dfd9e075e672f1624d66b96f2b1139cf74b89f9 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 3 Jun 2019 20:19:25 +0200 Subject: [PATCH] ssh: Fixes crash when using authorized keys (#602) --- ssh/CHANGELOG.md | 4 ++++ ssh/Dockerfile | 1 + ssh/config.json | 2 +- ssh/run.sh | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ssh/CHANGELOG.md b/ssh/CHANGELOG.md index 351ac9c..8882786 100644 --- a/ssh/CHANGELOG.md +++ b/ssh/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 5.6 + +- Fixes crash when using authorized keys + ## 5.5 - Rewrite add-on onto Bashio diff --git a/ssh/Dockerfile b/ssh/Dockerfile index 7a1ccda..1ddbd59 100644 --- a/ssh/Dockerfile +++ b/ssh/Dockerfile @@ -12,6 +12,7 @@ RUN apk add --no-cache \ mosquitto-clients \ nano \ openssh \ + pwgen \ tmux \ vim diff --git a/ssh/config.json b/ssh/config.json index 0b697ba..7ee0e95 100644 --- a/ssh/config.json +++ b/ssh/config.json @@ -1,6 +1,6 @@ { "name": "SSH server", - "version": "5.5", + "version": "5.6", "slug": "ssh", "description": "Allows connections over SSH", "url": "https://github.com/home-assistant/hassio-addons/tree/master/ssh", diff --git a/ssh/run.sh b/ssh/run.sh index aee13e4..f36707f 100755 --- a/ssh/run.sh +++ b/ssh/run.sh @@ -16,7 +16,7 @@ if bashio::config.has_value 'authorized_keys'; then sed -i s/#PasswordAuthentication.*/PasswordAuthentication\ no/ /etc/ssh/sshd_config # Unlock account - PASSWORD="$(strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c32)" + PASSWORD="$(pwgen -s 64 1)" echo "root:${PASSWORD}" | chpasswd 2&> /dev/null elif bashio::config.has_value 'password'; then bashio::log.info "Setup password login"