windows sshd powershell 配置
安装sshd
打开“设置”,选择“应用”>“应用和功能”,然后选择“可选功能” 。
扫描列表,查看是否已安装 OpenSSH。 如果未安装,请在页面顶部选择“添加功能”,然后:
查找“OpenSSH 客户端”,再单击“安装”
查找“OpenSSH 服务器”,再单击“安装”
开启sshd服务
# Start the sshd service
Start-Service sshd
# OPTIONAL but recommended:
Set-Service -Name sshd -StartupType 'Automatic'
免密登录:
服务端切换到C:\ProgramData\ssh\下(首次启动sshd后会生成该文件夹),打开sshd_config文件,
修改文件(以下是重点):
确保以下3条没有被注释
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication no
确保以下2条有注释掉 重点,这两行要注释
#Match Group administrators
# AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys
相关命令:
查看状态:Get-Service sshd
关闭服务:Stop-Service sshd
重启服务:Restart-Service sshd
为 Win10 的 OpenSSH 配置默认 shell:
先确认 OpenSSH 默认安装位置是:C:Windows\System32\openssh 。
cmd 中 path 和 PowerShell 中 $env:path 可以显示当前路径。
在 PowerShell 中用以下命令将默认 shell 设为 PowerShell:
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -PropertyType String -Force
powerShell 配置
安装需要的软件
Install-Module -AllowClobber Get-ChildItemColor
choco install ntop.portable
查看profile
$PROFILE
编辑profile 内容如下
set-alias vi "C:/Program Files (x86)/Vim/vim82/./vim.exe"
set-alias git "C:/Program Files/Git/bin/./git.exe"
set-alias top "C:/ProgramData/chocolatey/bin/ntop.exe"
Import-Module PSReadLine
If (-Not (Test-Path Variable:PSise)) {
# Only run this in the console and not in the ISE
Import-Module Get-ChildItemColor
Set-Alias l Get-ChildItem -option AllScope
Set-Alias ls Get-ChildItemColorFormatWide -option AllScope
}
# Shows navigable menu of all options when hitting Tab
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
# Autocompletion for arrow keys
Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
New-Alias open invoke-item
New-Alias which get-command
引用链接
https://zhuanlan.zhihu.com/p/356463854
https://docs.microsoft.com/zh-cn/windows-server/administration/openssh/openssh_install_firstuse
https://www.cnblogs.com/deepinnet/p/15228378.html
https://ld246.com/article/1598698273711
windows sshd powershell 配置的更多相关文章
- 安装Windows Azure Powershell
本文将介绍如何安装Windows Azure Powershell 1.打开Azure官方链接:https://www.azure.cn/downloads/ 2.按照向导进行安装 3.打开系统自带的 ...
- Windows 10 powershell 中文乱码解决方案
Windows 10 powershell 中文乱码解决方案 Intro 我装的系统是英文版的 win 10 操作系统,最近使用命令行测试接口,发现中文显示一直异常, 使用网上的各种解决方案都没有效果 ...
- Windows下Nginx配置SSL实现Https访问(包含证书生成)
Vincent.李 Windows下Nginx配置SSL实现Https访问(包含证书生成) Windows下Nginx配置SSL实现Https访问(包含证书生成) 首先要说明为什么要实现https ...
- 【经验之谈】Windows环境下配置WordPress
前言 wordpress全球著名的开放博客平台,拥有成千上万个各式插件和不计其数的主题模板样式,使用php和mysql搭建,下面说下载windows环境下配置wordpress,经验之谈. 安装 关于 ...
- 在windows下安装配置Ulipad
在windows下安装配置Ulipad 今天推荐一款轻便的文本编辑器Ulipad,用来写一些小的Python脚本非常方便. Ulipad下载地址: https://github.com/limodou ...
- How to build windows azure PowerShell Source Code
Download any version source code of Windows Azure Powershell from https://github.com/Azure/azure-sdk ...
- dpm-release3.1在windows下的配置
dpm-release3.1在windows下的配置 dpm是做目标检测objecjt detection的经典方法.dpm系列代码默认是在linux和mac下运行测试过的,windows下默认是不能 ...
- Windows下gvim配置
Windows下gvim配置原作地:http://hi.baidu.com/leemoncc/blog/item/a6be15cf40d7ab31b600c806.html 0.准备软件及插件. (a ...
- Windows Server 2008R2配置MySQL Cluster
目录 配置环境 相关知识 配置过程 配置 ini参数解释 启动集群 检查配置 同步测试 故障测试 写在之后 配置环境 VMware:(版本10.0.01) 操作系统:Windows Server 20 ...
- 使用Windows Azure PowerShell远程管理Windows Azure虚拟机
对于Windows Azure,如果你还在使用windowsazure.com门户来管理虚拟机,那就显得不怎么高上大了.Windows Azure PowerShell 是一个功能强大的脚本环境,可用 ...
随机推荐
- 计网学习笔记二 Link Layer Service
在上一周的计网学习了network和Internet的总论.在这一周开始的未来几讲将集中在链路层link layer,并且会有相应的计网lab完成.在这一讲中,我们主要关注链路层提供的服务. 课程资料 ...
- LeetCode-798 得分最高的最小论调 及差分和前缀和的学习
来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/smallest-rotation-with-highest-score 题目描述 给你一个数组 ...
- 09 安装虚拟机:Ubuntu Server 20.04
09 安装虚拟机:Ubuntu Server 20.04 9.1 取得安装映像档 9.2 建立虚拟机客体 请至Proxmox VE管理界面点选右上方的[建立VM],来到建立虚拟机客体的引导程序.引导程 ...
- opc ua与opc da区别
opc ua与opc da区别_OPC,OPCDA,OPCUA傻傻搞不清楚,走过路过不妨看一看 转自:https://blog.csdn.net/weixin_39624774/article/det ...
- 如何卸载win10自带的输入法?
如何卸载win10自带的输入法? 本来没想过卸载win10自带的微软拼音输入法,但是它和今天安装的搜狗拼音输入法不兼容,没办法,我就上网搜教程如何卸载它,教程亲试有效哦! 网址:http://www ...
- 高校github课程资源汇总
序号 学校名称 学校类型 课程资源链接 1 清华大学 Top 计算机系课程攻略 https://github.com/Salensoft/thu-cst-cracker https://github. ...
- <input>输入框,限制输入的为正整数
<input id="eventId" col="EventId" type="text" class="form-cont ...
- nginx 同一个域名根据后缀不同访问不同的项目
server { listen 80; server_name bcgx.work; location / { index login.html login.htm index.php; root / ...
- css animation 复刻
今天做了一个七巧板的小页面,发现对于css动画一些内容又有了新的认识,所以以下准备复习一遍 首先一共有以下属性 @keyframes 如果您在 @keyframes 规则中指定了 CSS 样式,动画将 ...
- 2023 新年FLAG 当你无所事事的时候,打开本博客看看,置顶着呢,别说你看不到,摸鱼狗
2023.2.15 接触到了Visual Grounding,但是是3D的,不知道这是不是冥冥之中的一颗种子,我现在有强烈的直觉我未来就是搞这个方向. 2023.2.14 回到学校正式开始工作 OK, ...