Files
openGauss-OM/script/local/sshexkey_encrypt_tool.sh
coolany eae422baf3 适配CM组件
Signed-off-by: coolany <kyosang@163.com>

support cgroup

追加合入
2022-03-05 18:51:52 +08:00

25 lines
623 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_rsa < /dev/null && chmod 600 ${cmd1} ${cmd2}"
eval $cmd
}
if [ "-$encrypt_type" = "-sshkeygen" ];then
echo "Generating mutual trust files"
func_sshkeygen_cmd
fi