支持预安装结束选择是否删除root互信

支持预安装建立root互信不影响老的互信关系
日志记录行号,方便定位
This commit is contained in:
hangjin2020
2022-04-29 16:07:27 +08:00
parent 4ec444dff8
commit 1f6d7f369d
7 changed files with 70 additions and 33 deletions

View File

@ -485,6 +485,11 @@ class DefaultValue():
# Cert type
GRPC_CA = "grpc"
SERVER_CA = "server"
# rsa file name
SSH_PRIVATE_KEY = os.path.expanduser("~/.ssh/id_om")
SSH_PUBLIC_KEY = os.path.expanduser("~/.ssh/id_om.pub")
SSH_AUTHORIZED_KEYS = os.path.expanduser("~/.ssh/authorized_keys")
SSH_KNOWN_HOSTS = os.path.expanduser("~/.ssh/known_hosts")
@staticmethod
def encodeParaline(cmd, keyword):
@ -2524,7 +2529,7 @@ class DefaultValue():
:return:
"""
DefaultValue.clear_ssh_id_rsa(mpprcfile, logger)
id_rsa_path = os.path.expanduser("~/.ssh/id_rsa")
id_rsa_path = DefaultValue.SSH_PRIVATE_KEY
cmd = "source %s;echo \"%s\" | /bin/sh %s %s" %(
mpprcfile, str(secret_word), shell_file, id_rsa_path)
if logger:
@ -2704,7 +2709,7 @@ class DefaultValue():
if logger:
logger.debug("Successfully to clear id_rsa in ssh-agent")
id_rsa_path = os.path.expanduser("~/.ssh/id_rsa")
id_rsa_path = DefaultValue.SSH_PRIVATE_KEY
cmd = "source %s;echo \"%s\" | /bin/sh %s %s" % (
mpprcfile, str(secret_word), shell_file, id_rsa_path)
if logger: