Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Config
Commits
ce5b9f01
Commit
ce5b9f01
authored
Apr 19, 2018
by
Igor Pecovnik
Browse files
Bugfix and UX improvements
parent
326c45c4
Changes
1
Show whitespace changes
Inline
Side-by-side
debian-config-jobs
View file @
ce5b9f01
...
...
@@ -952,7 +952,7 @@ function jobs ()
"SSH"
)
while
true
;
do
DIALOG_CANCEL
=
1
DIALOG_CANCEL
=
2
DIALOG_ESC
=
255
LIST_CONST
=
7
...
...
@@ -962,11 +962,11 @@ function jobs ()
PasswordAuthentication
=
""
;
PhoneAuthentication
=
""
MergeParameter
=
""
;
EXTRABUTTON
=
""
;
Buttons
=
"--no-cancel --ok-label "
Save
" --help-button --help-label Cancel"
# read values
[[
$(
grep
"^PermitRootLogin"
/etc/ssh/sshd_config |
awk
'{print $2}'
)
==
"yes"
]]
&&
PermitRootLogin
=
"on"
[[
$(
grep
"^
PasswordAuthentication"
/etc/ssh/sshd_config
|
awk
'{print $2}'
)
==
"
yes
"
]]
&&
PasswordAuthentication
=
"on"
[[
$(
grep
"^
@include common-auth"
/etc/pam.d/sshd
|
awk
'{print $2}'
)
==
"
common-auth
"
]]
&&
PasswordAuthentication
=
"on"
[[
$(
grep
"^PubkeyAuthentication"
/etc/ssh/sshd_config |
awk
'{print $2}'
)
==
"yes"
]]
&&
PubkeyAuthentication
=
"on"
[[
-n
$(
grep
"pam_google_authenticator.so"
/etc/pam.d/sshd
)
]]
&&
PhoneAuthentication
=
"on"
...
...
@@ -977,15 +977,17 @@ function jobs ()
MOTD+
=(
"PhoneAuthentication"
"Mobile phone one-time passcode"
"
$PhoneAuthentication
"
)
LISTLENGHT
=
"
$((
$LIST_CONST
+
${#
MOTD
[@]
}
/
2
))
"
Buttons
=
"--no-cancel --ok-label "
Save
" --help-button --help-label Cancel"
if
[[
$PhoneAuthentication
==
"on"
]]
;
then
EXTRABUTTON
=
"--help-button --help-label Generate-token"
;
[[
-f
~/.google_authenticator
]]
&&
EXTRABUTTON
=
"--help-button --help-label Generate-token --extra-button --extra-label Show-token"
;
Buttons
=
"--cancel-label Generate-token --ok-label "
Save
" --help-button --help-label Cancel"
if
[[
-f
~/.google_authenticator
]]
;
then
Buttons
=
"--cancel-label New-token --ok-label "
Save
" --help-button --help-label Cancel --extra-button --extra-label Show-token"
fi
fi
exec
3>&1
selection
=
$(
dialog
$EXTRABUTTON
--backtitle
"
$BACKTITLE
"
--title
" Toggle sshd options "
--clear
--cancel-label
\
"Cancel"
--ok-label
"Save"
--checklist
"
\n
Choose what you want to enable or disable:
\n
"
\
$LISTLENGHT
80 21
"
${
MOTD
[@]
}
"
2>&1 1>&3
)
selection
=
$(
dialog
$Buttons
--backtitle
"
$BACKTITLE
"
--title
" Toggle sshd options "
--clear
--checklist
\
"
\n
Choose what you want to enable or disable:
\n
"
$LISTLENGHT
80 21
"
${
MOTD
[@]
}
"
2>&1 1>&3
)
exit_status
=
$?
exec
3>&-
...
...
@@ -1063,7 +1065,7 @@ function jobs ()
3
)
display_qr_code
;;
2
)
1
)
google-authenticator
-t
-d
-f
-r
3
-R
30
-W
-q
display_qr_code
;;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment