通过 SSH 以 Root 用户登录到 ESXi 主机的命令行,使用以下命令重新生成新的 SSL 证书。
/sbin/generate-certificates
/etc/init.d/hostd restart && /etc/init.d/vpxa restart

如果你不想一个一个 SSH 登录到 ESXi 主机,也可以运行下面的 Powershell 脚本(管理员身份)来重新生成新的 SSL 证书。
# Install the Posh-SSH module if not already installed
Install-Module -Name Posh-SSH -Force
# Define the ESXi host details
$esxiHost = "192.168.32.62"
$username = "root"
$password = "Vcf5@password"
# Convert the password to a secure string
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
# Create the credential object
$credential = New-Object System.Management.Automation.PSCredential ($username, $securePassword)
# Establish the SSH session
$session = New-SSHSession -ComputerName $esxiHost -Credential $credential
# Run the command to regenerate certificates
Invoke-SSHCommand -SessionId $session.SessionId -Command '/sbin/generate-certificates'
# Restart the hostd service
Invoke-SSHCommand -SessionId $session.SessionId -Command '/etc/init.d/hostd restart && /etc/init.d/vpxa restart'
# Close the SSH session
Remove-SSHSession -SessionId $session.SessionId

© 版权声明
文章版权归作者所有,未经允许请勿转载。
相关文章
暂无评论...