File tree Expand file tree Collapse file tree 3 files changed +6
-18
lines changed Expand file tree Collapse file tree 3 files changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -58,22 +58,6 @@ configure()
58
58
}
59
59
}
60
60
61
- # Check for insecure default ncp password ( taken from old jessie method )
62
- local SHADOW=" $( grep -E ' ^ncp:' /etc/shadow ) "
63
- test -n " ${SHADOW} " && {
64
- local SALT=$( echo " ${SHADOW} " | sed -n ' s/ncp:\$6\$//;s/\$.*//p' )
65
- local HASH=$( mkpasswd -msha-512 ownyourbits " $SALT " )
66
-
67
- grep -q " ${HASH} " <<< " ${SHADOW}" && {
68
- systemctl stop ssh
69
- systemctl disable ssh
70
- echo " The user ncp is using the default password. Refusing to activate SSH"
71
- echo " You can change this password from nc-passwd"
72
- echo " SSH disabled"
73
- return 1
74
- }
75
- }
76
-
77
61
# Enable
78
62
chage -d 0 " $USER_ "
79
63
systemctl enable ssh
Original file line number Diff line number Diff line change 94
94
a2ensite ncp
95
95
96
96
# # NCP USER FOR AUTHENTICATION
97
- useradd $WEBADMIN
98
- echo -e " $WEBPASSWD \n$WEBPASSWD " | passwd $WEBADMIN
97
+ useradd --home-dir /nonexistent " $WEBADMIN "
98
+ echo -e " $WEBPASSWD \n$WEBPASSWD " | passwd " $WEBADMIN "
99
+ chsh -s /usr/sbin/nologin " $WEBADMIN "
99
100
100
101
# # NCP LAUNCHER
101
102
mkdir -p /home/www
Original file line number Diff line number Diff line change 244
244
grep -q sleep " $F2BUNIT " || sed -i " /^ExecStart=/iExecStartPre=/bin/sleep 10" " $F2BUNIT "
245
245
grep -q sleep " $SWPUNIT " || sed -i " /\<start)/asleep 30" " $SWPUNIT "
246
246
247
+ # disable ncp user login
248
+ chsh -s /usr/sbin/nologin ncp
249
+
247
250
} # end - only live updates
248
251
249
252
exit 0
You can’t perform that action at this time.
0 commit comments