File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 1
1
2
- [ v0.41.2] ( https://github.com/nextcloud/nextcloudpi/commit/f4dd242 ) (2017-12-04) nc-automount: check for USBdrive labeled drive case
2
+ [ v0.41.3] ( https://github.com/nextcloud/nextcloudpi/commit/bf1ff0e ) (2017-12-05) SSH: enhance security
3
+
4
+ [ v0.41.2 ] ( https://github.com/nextcloud/nextcloudpi/commit/a2c5de7 ) (2017-12-04) nc-automount: check for USBdrive labeled drive case
3
5
4
6
[ v0.41.1 ] ( https://github.com/nextcloud/nextcloudpi/commit/9ef8bc1 ) (2017-12-04) nc-info: warn of long operation
5
7
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ configure()
39
39
id " $USER_ " & > /dev/null || useradd " $USER_ "
40
40
echo -e " $PASS_ \n$CONFIRM_ " | passwd " $USER_ " || return 1
41
41
42
- # Check for insecure default password ( taken from old jessie method )
42
+ # Check for insecure default pi password ( taken from old jessie method )
43
43
local SHADOW=" $( grep -E ' ^pi:' /etc/shadow ) "
44
44
test -n " ${SHADOW} " && {
45
45
local SALT=$( echo " ${SHADOW} " | sed -n ' s/pi:\$6\$//;s/\$.*//p' )
@@ -54,7 +54,23 @@ configure()
54
54
}
55
55
}
56
56
57
+ # Check for insecure default ncp password ( taken from old jessie method )
58
+ local SHADOW=" $( grep -E ' ^ncp:' /etc/shadow ) "
59
+ test -n " ${SHADOW} " && {
60
+ local SALT=$( echo " ${SHADOW} " | sed -n ' s/ncp:\$6\$//;s/\$.*//p' )
61
+ local HASH=$( mkpasswd -msha-512 ownyourbits " $SALT " )
62
+
63
+ grep -q " ${HASH} " <<< " ${SHADOW}" && {
64
+ systemctl stop ssh
65
+ systemctl disable ssh
66
+ echo " The user ncp is using the default password. Refusing to activate SSH"
67
+ echo " SSH disabled"
68
+ return 1
69
+ }
70
+ }
71
+
57
72
# Enable
73
+ chage -d 0 " $USER_ "
58
74
systemctl enable ssh
59
75
systemctl start ssh
60
76
echo " SSH enabled"
You can’t perform that action at this time.
0 commit comments