win 10 使用SSH 连接

news/2024/10/6 3:59:52/文章来源:https://www.cnblogs.com/zeng-qh/p/18288883

本教程建议使用win 10 、win 11 非家庭版使用

首先安装 ssh 服务端 

 

 

 

  Get-Service -Name *ssh*   #查看服务

 ssh -V  #查看ssh 版本

netstat -an |findstr :22 # 查看端口是否被监听

ipconfig # 查看本机IP 

 

ssh administrator@IP

在用户/.ssh 目录下创建文件

authorized_keys  将客户端生成的公钥拷贝本文件中

 

 C:\ProgramData\ssh\sshd_config 文件修改

取消注释 

PubkeyAuthentication yes

修改后的sshd_config文件

# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.

#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

#HostKey __PROGRAMDATA__/ssh/ssh_host_rsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_dsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_ecdsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
#PermitRootLogin prohibit-password
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

PubkeyAuthentication yes

# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile .ssh/authorized_keys

#AuthorizedPrincipalsFile none

# For this to work you will also need host keys in %programData%/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication yes
#PermitEmptyPasswords no

# GSSAPI options
#GSSAPIAuthentication no

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# no default banner path
#Banner none

# override default of no subsystems
Subsystem sftp sftp-server.exe

# Example of overriding settings on a per-user basis
#Match User anoncvs
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server

#Match Group administrators
# AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/739952.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

音视频录制与播放原理

图片来源于网上学习资料,零声学院!

2.基于Containerd运行时搭建Kubernetes多控制平面集群实践-腾讯云开发者社区-腾讯云

https://cloud.tencent.com/developer/article/21298462.基于Containerd运行时搭建Kubernetes多控制平面集群实践发布于 2022-09-29 19:27:531K0 举报文章被收录于专栏:全栈工程师修炼之路[TOC]0x00 前言简述 本章主要讲述,如果使用kubeadm进行安装配置K8S集群,并指定使用co…

【寻迹】二分与三分

二分与三分 二分是一种常用且非常精妙的算法。(英才计划甚至还水了一篇文章)三分法则可以用来解决单峰函数的极值以及相关问题 一、二分 二分法,在一个单调有序的集合或函数中查找一个解,每次均分为左右两部分,判断解在哪一个部分后调整上下界。每次二分都会舍弃一半区间,…

xftp实现linux服务器传输文件

1.xftp下载网址:https://www.xshell.com/zh/free-for-home-school/,下载后下一步安装即可 2.ip addr show查看ip地址,配置xftp连接服务器,找到对应路径传输文件 以上仅供参考,如有疑问,留言联系

markdowm语法Typora练习草稿

目录这是一级标题 这是一级标题 【Typora 教程】手把手教你如何用Typora撰写笔记_哔哩哔哩_bilibili 这是第一行 这是第二行 这是一个段落 这是一个段落这是粗体 这是斜体 这是删除线 这是下划线 这是高亮 格式里面有快捷键 1*2*3*4*5 x2 H2O一级分类二级分类三级分类tab 键 升…

视野修炼-技术周刊第91期 | 惊讶线条

① 漫画:浏览器的 UA 为什么这么长? ② 500+种js方法实现页面重载 ③ CSS 实现惊讶线条 ④ onefetch - 本地仓库信息查看工具 ⑤ StarFlare - 管理 Star 的项目 ⑥ 开源项目落地页模板 ⑦ 纯CSS鉴别是不是Safari浏览器 ⑧ 使用 MarsCode IDE 搭建 VitePress博客并使用 GitHub…

SpringBoot3 整合 Logback

SpringBoot3 整合 Logback 日志框架1. 默认框架实现 SpringBoot3 默认是使用 SLF4J + Logback 作为默认的日志门面和实现,但也支持其他日志系统,如 Log4j2、JUL (Java Util Logging), 这是通过所谓的日志门面实现的,开发者可以根据自己的需求选择合适的日志实现框架进行配置…

[LeetCode] 238. Product of Array Except Self

坑真的很多,首先要处理全零reduce没有值typeerror的问题。 class Solution:def productExceptSelf(self, nums: List[int]) -> List[int]:total=reduce(mul, nums)ret =[]if total == 0:try:total = reduce(mul, [x for x in nums if x != 0]) except TypeError:#default v…

灰色预测代码的讲解

本章通过一个例题,来讲解灰色预测代码。由于笔者只是以学习者的身份,以做笔记为目的写这篇博客,因此欢迎大家学习交流,代码(非本人所写)会附在最后面 目录一、总述————如何处理预测题目?1.画出时序图,分析趋势2.检验与比较模型————训练与试验3.得出结论————…

CRT工具

CRT工具 传输位置设置打开SFTP alt + p 命令 ls:远程机器当前目录内容 lls:传输位置文件的目录内容 pwd:远程机器的当前位置 lpwd:传输位置的位置 get 文件:ftp传输文件 get -r 文件夹:ftp传输文件夹 put 文件:ftp传输文件 put -r 文件夹:ftp传输文件夹 lrm -rf 文件/文…

硬件开发笔记(二十三):贴片电阻的类别、封装介绍,AD21导入贴片电阻原理图封装库3D模型

前言电阻,电容,电感还有各种基础的电子元器件、连接器和IC构成了各种实现功能的电子电路。  本篇介绍贴片电阻,并将贴片电阻封装导入AD21,预览其三维模型。 贴片电阻贴片电阻(SMD Resistor)作为一种不可或缺的电子元件,广泛应用于各种电路和设备中。其体积小、重量轻、…

EtherCAT转Profinet网关配置说明第三讲:博图配置

XD-ECPNS20网关模块实现EtherCAT与Profinet协议转换设备,简化工业控制系统建设与维护。EtherCAT协议转Profinet协议网关模块是实现EtherCAT协议和Profinet协议之间无缝通讯的重要设备。使EtherCAT协议和Profinet协议能够相互转换,进行工控自动化里的互连和传送数据。EtherCAT…