diff --git a/scripts/ssh-server-check.sh b/scripts/ssh-server-check.sh index ae8cf2a..0972f33 100755 --- a/scripts/ssh-server-check.sh +++ b/scripts/ssh-server-check.sh @@ -133,6 +133,7 @@ check_ssh_config_files() { case "$status" in missing) CREATE_USER_CA=1;; esac + echo } ssh_fingerprint() { @@ -179,6 +180,7 @@ EOF fi fi restart_sshd + echo } restart_sshd() { @@ -196,7 +198,10 @@ restart_sshd() { } create_files() { + local wrote_lines=0 + if [[ $CREATE_HOST_CERT -eq 1 ]]; then + wrote_lines=1 prompt_user "SSH Host" "Cert missing. Sign the ssh host cert?" if [[ $REPLY =~ ^[Yy]$ ]]; then update_prompt $YELLOW_BANG "Signing ssh host cert" @@ -207,6 +212,7 @@ create_files() { fi if [[ $CREATE_USER_CA -eq 1 ]]; then + wrote_lines=1 prompt_user "SSH Host" "Create the trusted keys file?" if [[ $REPLY =~ ^[Yy]$ ]]; then (step ssh config --roots > "$path") @@ -215,18 +221,18 @@ create_files() { update_prompt $RED_X fi fi + + if [[ $wrote_lines -eq 1 ]]; then echo; fi } # Run Process check_cert_config "certs.conf" -echo check_ssh_config_files - create_files -title_msg "\nSSH Host Cert" "$SSH_HOST_CERT\n" +title_msg "SSH Host Cert" "$SSH_HOST_CERT\n" CERT_INFO=$(ssh-keygen -Lf "$SSH_HOST_CERT") echo -e "$CERT_INFO" | grep "Public key" echo -e "$CERT_INFO" | grep "Valid"