Files
openGauss-OM/script/local/sshexkey_encrypt_tool.sh
hangjin2020 1f6d7f369d 支持预安装结束选择是否删除root互信
支持预安装建立root互信不影响老的互信关系
日志记录行号,方便定位
2022-05-09 15:38:00 +08:00

25 lines
622 B
Bash

#!/bin/bash
#############################################################################
# Copyright (c): 2021-2025, Huawei Tech. Co., Ltd.
# FileName : sshexkey_encrypt_tool.sh
# Version : V1.0.0
# Date : 2022-02-13
#############################################################################
read -r secret
encrypt_type="$1"
passwd=$secret
cmd1="$2"
cmd2="$3"
func_sshkeygen_cmd()
{
cmd="ssh-keygen -t ed25519 -N \"$passwd\" -f ~/.ssh/id_om < /dev/null && chmod 600 ${cmd1} ${cmd2}"
eval $cmd
}
if [ "-$encrypt_type" = "-sshkeygen" ];then
echo "Generating mutual trust files"
func_sshkeygen_cmd
fi