| window配置vscode免密登录打开window的cmd命令行窗口
 
ssh-keygen
 将秘钥发送到目标机器上,输入bash命令, 即可进入到linux操作命令模式
 执行如下代码
 PS C:\Users\admin\.ssh> ssh-copy-id -i id_rsa.pub root@服务器IP
root@服务器IP's password:
  遇到问题 在windows10上配置时,会遇到如下错误:  
   ssh-copy-id : 无法将“ssh-copy-id”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
 
function ssh-copy-id([string]$userAtMachine, $args){   
    $publicKey = "$ENV:USERPROFILE" + "/.ssh/id_rsa.pub"
    if (!(Test-Path "$publicKey")){
        Write-Error "ERROR: failed to open ID file '$publicKey': No such file"            
    }
    else {
        & cat "$publicKey" | ssh $args $userAtMachine "umask 077; test -d .ssh || mkdir .ssh ; cat >> .ssh/authorized_keys || exit 1"      
    }
}
 |