🚑 SSH: Hotfix issue where user was unable to log in without having a password set

This commit is contained in:
Franck Nijhof 2017-08-16 23:33:19 +02:00
parent a47d591e52
commit 9784b670f3
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3
4 changed files with 9 additions and 4 deletions

View file

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## Unreleased
-
## 1.0.3 - 2017-08-16
### Changed
- Fix issue: User with key and without password was unable to log in
This time for real ;)
## 1.0.2 - 2017-08-16
### Changed

View file

@ -1,6 +1,6 @@
{
"name": "SSH - Secure Shell",
"version": "1.0.2",
"version": "1.0.3",
"slug": "ssh",
"description": "Allows SSH connections to your Home Assistant instance",
"url": "https://github.com/hassio-addons/repository/tree/master/ssh",

View file

@ -225,8 +225,8 @@ setup_user() {
display_status_message "Creating user to use for login"
(command adduser -D "$username" -s "/bin/sh" && \
command adduser "$username" wheel) || \
display_error_message 'Failed creating an user account for login' \
"$EX_USER_ADD"
display_error_message 'Failed creating an user account for login' \
"$EX_USER_ADD"
echo 'exec sudo su -l' > "/home/$username/.profile" || \
display_error_message 'Failed configuring user profile' \
@ -292,6 +292,7 @@ setup_password_authentication() {
command sed -i "s/PasswordAuthentication.*/PasswordAuthentication\ yes/" \
"$SSH_CONFIG_PATH"
else
echo "$username:$username" | chpasswd 2&> /dev/null
display_status_message 'Login using a password is disabled'
fi
}

View file

@ -37,7 +37,7 @@ PubkeyAuthentication yes
IgnoreRhosts yes
HostbasedAuthentication no
IgnoreUserKnownHosts no
PermitEmptyPasswords yes
PermitEmptyPasswords no
ChallengeResponseAuthentication no
PasswordAuthentication no
AuthorizedKeysFile /etc/ssh/authorized_keys