|
@@ -34,6 +34,7 @@ SSH_CIPHERS=
|
34
|
34
|
SSH_MACS=
|
35
|
35
|
SSH_KEX=
|
36
|
36
|
SSH_HOST_KEY_ALGORITHMS=
|
|
37
|
+SSH_PASSWORDS=
|
37
|
38
|
XMPP_CIPHERS=
|
38
|
39
|
XMPP_ECC_CURVE=
|
39
|
40
|
|
|
@@ -105,6 +106,7 @@ function get_ssh_settings {
|
105
|
106
|
SSH_CIPHERS=$(cat $SSH_CONFIG | grep 'Ciphers ' | awk -F 'Ciphers ' '{print $2}')
|
106
|
107
|
SSH_MACS=$(cat $SSH_CONFIG | grep 'MACs ' | awk -F 'MACs ' '{print $2}')
|
107
|
108
|
SSH_KEX=$(cat $SSH_CONFIG | grep 'KexAlgorithms ' | awk -F 'KexAlgorithms ' '{print $2}')
|
|
109
|
+ SSH_PASSWORDS=$(cat $SSH_CONFIG | grep 'PasswordAuthentication ' | awk -F 'PasswordAuthentication ' '{print $2}')
|
108
|
110
|
fi
|
109
|
111
|
if [ -f /etc/ssh/ssh_config ]; then
|
110
|
112
|
SSH_HOST_KEY_ALGORITHMS=$(cat /etc/ssh/ssh_config | grep 'HostKeyAlgorithms ' | awk -F 'HostKeyAlgorithms ' '{print $2}')
|
|
@@ -175,10 +177,14 @@ function change_ssh_settings {
|
175
|
177
|
if [ ! $SSH_KEX ]; then
|
176
|
178
|
return
|
177
|
179
|
fi
|
|
180
|
+ if [ ! $SSH_PASSWORDS ]; then
|
|
181
|
+ return
|
|
182
|
+ fi
|
178
|
183
|
|
179
|
184
|
sed -i "s|Ciphers .*|Ciphers $SSH_CIPHERS|g" $SSH_CONFIG
|
180
|
185
|
sed -i "s|MACs .*|MACs $SSH_MACS|g" $SSH_CONFIG
|
181
|
186
|
sed -i "s|KexAlgorithms .*|KexAlgorithms $SSH_KEX|g" $SSH_CONFIG
|
|
187
|
+ sed -i "s|PasswordAuthentication .*|PasswordAuthentication $SSH_PASSWORDS|g" $SSH_CONFIG
|
182
|
188
|
service ssh restart
|
183
|
189
|
echo 'ssh server security settings changed'
|
184
|
190
|
fi
|
|
@@ -254,6 +260,23 @@ function interactive_setup {
|
254
|
260
|
esac
|
255
|
261
|
fi
|
256
|
262
|
|
|
263
|
+ if [[ $SSH_PASSWORDS == "yes" ]]; then
|
|
264
|
+ dialog --title "SSH Passwords" \
|
|
265
|
+ --backtitle "Freedombone Security Configuration" \
|
|
266
|
+ --yesno "\nAllow SSH login using passwords?" 7 60
|
|
267
|
+ else
|
|
268
|
+ dialog --title "SSH Passwords" \
|
|
269
|
+ --backtitle "Freedombone Security Configuration" \
|
|
270
|
+ --defaultno \
|
|
271
|
+ --yesno "\nAllow SSH login using passwords?" 7 60
|
|
272
|
+ fi
|
|
273
|
+ sel=$?
|
|
274
|
+ case $sel in
|
|
275
|
+ 0) SSH_PASSWORDS="yes";;
|
|
276
|
+ 1) SSH_PASSWORDS="no";;
|
|
277
|
+ 255) exit 0;;
|
|
278
|
+ esac
|
|
279
|
+
|
257
|
280
|
if [ $XMPP_CIPHERS ]; then
|
258
|
281
|
data=$(tempfile 2>/dev/null)
|
259
|
282
|
trap "rm -f $data" 0 1 2 5 15
|