生成新的 SSH 公私钥对
以下PowerShell脚本检查是否存在已有的 SSH 公私钥对,如果不存在,则生成一对新的公私钥对
if ( (-not (Test-Path -Path $HOME/.ssh -PathType Container)) -or `
(-not (Test-Path -Path $HOME/.ssh/id_rsa.pub -PathType Leaf)) -or `
(-not (Test-Path -Path $HOME/.ssh/id_rsa -PathType Leaf)) ) {
ssh-keygen
}
查看公钥
cat $HOME/.ssh/id_rsa.pub
标签:Shell,rsa,ssh,key,HOME,Test,Path,id
From: https://www.cnblogs.com/wuhailong/p/16640166.html