VPS
圈内最新资讯与活动分享

Windows 使用 CMD 连接 SSH(密钥登录)

OpenSSH(Open Secure Shell)是一个用于安全远程登录和其他网络服务的开源工具套件。
从 Windows 10 版本 1809 和 Windows Server 2019 开始,Windows 系统正式支持 OpenSSH 客户端和服务器功能。

1、把key.pem密钥文件 复制到 ~/.ssh/
~/.ssh = C:\Users\用户\.ssh

2、打开~/.ssh/新建 config 文件(无后缀), 内容:

Host server
  HostName 192.168.1.99
  Port 22
  User root
  IdentityFile ~/.ssh/key.pem
  • Host:别名(可随意定义)
  • HostName:IP地址
  • Port:端口(如果是默认端口22 可以忽略)
  • User:用户
  • IdentityFile:密钥文件位置
  • 3、打开 CMD终端 连接,ssh Host 或者 ssh HostName都可以

    例如:

    ssh server
    ssh 192.168.1.99

    第一次连接会提示,输入 yes
    This key is not known by any other names.
    Are you sure you want to continue connecting (yes/no/[fingerprint])?

    赞(0)
    未经允许不得转载:主机圈 » Windows 使用 CMD 连接 SSH(密钥登录)
    分享短链

    主机圈

    VPS圈内最新资讯与活动分享