broke out create_files
This commit is contained in:
@@ -195,15 +195,9 @@ restart_sshd() {
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Run Process
|
||||
|
||||
check_cert_config "certs.conf"
|
||||
echo
|
||||
check_ssh_config_files
|
||||
|
||||
create_files() {
|
||||
if [[ $CREATE_HOST_CERT -eq 1 ]]; then
|
||||
prompt_user "SSH Host" "SSH host cert missing. Sign the ssh host cert?"
|
||||
prompt_user "SSH Host" "Cert missing. Sign the ssh host cert?"
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
update_prompt $YELLOW_BANG "Signing ssh host cert"
|
||||
sign_host_cert
|
||||
@@ -212,16 +206,28 @@ if [[ $CREATE_HOST_CERT -eq 1 ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# CREATE_USER_CA=1
|
||||
if [[ $CREATE_USER_CA -eq 1 ]]; then
|
||||
prompt_user "User CA" "Create the trusted keys file?"
|
||||
prompt_user "SSH Host" "Create the trusted keys file?"
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
(step ssh config --roots > "$path")
|
||||
update_prompt $GREEN_CHECK "User CA" "Created the trusted keys file."
|
||||
update_prompt $GREEN_CHECK "SSH Host" "Created the trusted keys file for the SSH host."
|
||||
else
|
||||
update_prompt $RED_X
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
echo -e "\n$SSH_HOST_CERT"
|
||||
ssh-keygen -Lf "$SSH_HOST_CERT" | grep "Public key" | sed 's/^ *//'
|
||||
|
||||
# Run Process
|
||||
|
||||
check_cert_config "certs.conf"
|
||||
echo
|
||||
check_ssh_config_files
|
||||
|
||||
create_files
|
||||
|
||||
title_msg "\nSSH 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"
|
||||
echo -e "$CERT_INFO" | grep -A3 "Principals"
|
||||
|
||||
Reference in New Issue
Block a user