polishing
This commit is contained in:
@@ -133,6 +133,7 @@ check_ssh_config_files() {
|
|||||||
case "$status" in
|
case "$status" in
|
||||||
missing) CREATE_USER_CA=1;;
|
missing) CREATE_USER_CA=1;;
|
||||||
esac
|
esac
|
||||||
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
ssh_fingerprint() {
|
ssh_fingerprint() {
|
||||||
@@ -179,6 +180,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
restart_sshd
|
restart_sshd
|
||||||
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
restart_sshd() {
|
restart_sshd() {
|
||||||
@@ -196,7 +198,10 @@ restart_sshd() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
create_files() {
|
create_files() {
|
||||||
|
local wrote_lines=0
|
||||||
|
|
||||||
if [[ $CREATE_HOST_CERT -eq 1 ]]; then
|
if [[ $CREATE_HOST_CERT -eq 1 ]]; then
|
||||||
|
wrote_lines=1
|
||||||
prompt_user "SSH Host" "Cert missing. Sign the ssh host cert?"
|
prompt_user "SSH Host" "Cert missing. Sign the ssh host cert?"
|
||||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||||
update_prompt $YELLOW_BANG "Signing ssh host cert"
|
update_prompt $YELLOW_BANG "Signing ssh host cert"
|
||||||
@@ -207,6 +212,7 @@ create_files() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $CREATE_USER_CA -eq 1 ]]; then
|
if [[ $CREATE_USER_CA -eq 1 ]]; then
|
||||||
|
wrote_lines=1
|
||||||
prompt_user "SSH Host" "Create the trusted keys file?"
|
prompt_user "SSH Host" "Create the trusted keys file?"
|
||||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||||
(step ssh config --roots > "$path")
|
(step ssh config --roots > "$path")
|
||||||
@@ -215,18 +221,18 @@ create_files() {
|
|||||||
update_prompt $RED_X
|
update_prompt $RED_X
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $wrote_lines -eq 1 ]]; then echo; fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Run Process
|
# Run Process
|
||||||
|
|
||||||
check_cert_config "certs.conf"
|
check_cert_config "certs.conf"
|
||||||
echo
|
|
||||||
check_ssh_config_files
|
check_ssh_config_files
|
||||||
|
|
||||||
create_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")
|
CERT_INFO=$(ssh-keygen -Lf "$SSH_HOST_CERT")
|
||||||
echo -e "$CERT_INFO" | grep "Public key"
|
echo -e "$CERT_INFO" | grep "Public key"
|
||||||
echo -e "$CERT_INFO" | grep "Valid"
|
echo -e "$CERT_INFO" | grep "Valid"
|
||||||
|
|||||||
Reference in New Issue
Block a user