Win10 ssh
配置过程
# 1. 首先生成密钥对
ssh-keygen -t rsa #-t 表示类型选项,这里采用 rsa 加密算法
# 2. 上传公钥
ssh-copy-id root@192.168.0.1
遇到问题
在 windows10 上配置时,会遇到如下错误:
ssh-copy-id : 无法将 “ssh-copy-id” 项识别为 cmdlet、函数、脚本文件或可运行程序的名称。
解决方案是在 powershell 中,先执行以下内容:
123456789function 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': ...