paramiko连接windows10详解,远程管理windows服务器
1、win10安装 OpenSSH
官网链接:https://docs.microsoft.com/zh-cn/windows-server/administration/openssh/openssh_install_firstuse
按住shift键,在某个目录点击鼠标右键,点击打开powershell

1、安装软件
# Install the OpenSSH Client
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0 # Install the OpenSSH Server
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 2、启动软件
# Start the sshd service
Start-Service sshd # OPTIONAL but recommended:
Set-Service -Name sshd -StartupType 'Automatic' # Confirm the firewall rule is configured. It should be created automatically by setup.
Get-NetFirewallRule -Name *ssh* # There should be a firewall rule named "OpenSSH-Server-In-TCP", which should be enabled
# If the firewall does not exist, create one
New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH Server (sshd)' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 3、卸载软件
# Uninstall the OpenSSH Client
Remove-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0 # Uninstall the OpenSSH Server
Remove-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
执行命令在里面



2、连接windows程序
import paramiko
ssh = paramiko.SSHClient() ssh.load_system_host_keys() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect('192.168.*.*',port = 22, username='ADMINISTRATOR',password='****') print ("Connected to %s" % '192.168.*.*') stdin, stdout, stderr = ssh.exec_command('dir d:')
aa=stdout.read()
bb=stderr.read()
print(aa.decode('gbk'))
print('==========================')
print(bb.decode('gbk'))


3、执行cmd命令,如开启服务


4、运行wmic命令
windows cmd命令学习:https://www.cnblogs.com/machangwei-8/p/10859951.html
ip='127.0.0.1'
ssh.connect(ip,port = 22, username='ADMINISTRATOR',password='m1xxx')

paramiko连接windows10详解,远程管理windows服务器的更多相关文章
- Windows 上的 SSH?使用 PowerShell Remoting 远程管理 Windows 服务器
作者:陈计节 个人博客:https://blog.jijiechen.com/post/powershell-remoting/ 在 Linux/Unix 世界里 SSH 是个好东西,SSH 是 Se ...
- [Windows]远程管理服务WinRM远程管理Windows服务器 Invalid use of command line. Type "winrm -?" for help.
运行环境 Windows 2012 R2 1. Windows需要打开WinRM服务,Server系统默认打开,默认端口5985 # WinRM服务查看 PS C:\Users\Administrat ...
- C3P0连接池详解及配置
C3P0连接池详解及配置 本人使用的C3P0的jar包是:c3p0-0.9.1.jar <bean id = "dataSource" class = "com.m ...
- [转帖]Ansible批量远程管理Windows主机(部署与配置)
2018-09-12 12:04:42 https://blog.51cto.com/7424593/2174156 一.测试环境介绍 Ansible管理主机: 系统: CentOS6.8 IP ...
- VC编译连接选项详解
VC编译连接选项详解 大家可能一直在用VC开发软件,但是对于这个编译器却未必很了解.原因是多方面的.大多数情况下,我们只停留在“使用”它,而不会想去“了解”它.因为它只是一个工具,我们宁可把更多的精力 ...
- Ansible批量远程管理Windows主机(部署与配置)
一.测试环境介绍 Ansible管理主机: 系统: CentOS6.8 IP Addr: 172.16.10.22 Linux管理服务器需安装pip.pywinrm插件 Windows客户端主机: ...
- Fragment详解之三——管理Fragment(1)
相关文章: 1.<Fragment详解之一--概述>2.<Fragment详解之二--基本使用方法>3.<Fragment详解之三--管理Fragment(1)>4 ...
- 图文详解如何搭建Windows的Android C++开发环境
原地址:http://www.apkbus.com/android-18595-1-1.html //================================================= ...
- day09 详解内存管理机制
""" 今日内容:详解内存管理 1.引用计数 在内存中为了对变量的值进行标记从而方便管理,采用引用计数的方式对变量进行标记. (1)如果变量的值被引用一次,那么该变量的引 ...
- 使用OpenSSH远程管理Linux服务器
一.使用OpenSSH远程管理Linux服务器 sshd是OpenSSH的服务器端守护进程,与之对应的Windows下客户端软件有SecureCRT/Xshell/PuTTY等. OpenSSH一般为 ...
随机推荐
- 使用OHOS SDK构建lua
参照OHOS IDE和SDK的安装方法配置好开发环境. 从github下载源码. 执行如下命令: git clone --depth=1 https://github.com/lua/lua.git ...
- JDK12的新特性:teeing collectors
目录 简介 talk is cheap, show me the code Teeing方法深度剖析 Characteristics 总结 简介 JDK12为java.util.stream.Coll ...
- OpenHarmony 状态变量更改通知:@Watch 装饰器
@Watch 应用于对状态变量的监听.如果开发者需要关注某个状态变量的值是否改变,可以使用 @Watch 为状态变量设置回调函数. 说明: 从 API version 9 开始,该装饰器支持在 Ark ...
- OpenHarmony 3.1 Release版本关键特性解析——ArkUI框架又有哪些新增能力?
ArkUI 是一套 UI 开发框架,它提供了开发者进行应用 UI 开发时所必须的能力.随着 OpenAtom OpenHarmony(以下简称"OpenHarmony") 3.1 ...
- 使用 OpenCV 进行文档矫正
使用 OpenCV 进行文档矫正 本文只发布于博客园与pchar博客 std::vector<std::vector<cv::Point>> cvhelper::findCor ...
- Git 07 IDEA基本使用
IDEA 是目前最流行的 Java 集成开发环境,我们一般使用 Git 都是在 IDEA 上操作. 这里以 2021.3.2 版 IDEA 为例. 克隆项目 1.复制 Gitee 上的项目地址 2.点 ...
- github 小技巧
前言 简单记一下github 小技巧,因为经常忘. 正文 就是如何快速搜索到自己想找的项目. 如果自己知道项目名,那么直接输入就可以搜索到. 如果不是,那么一般要通过高级搜索. https://git ...
- 重新点亮shell————测试命令[六]
前言 我们写好脚本之后希望有一个测试. 正文 介绍一下exit,如果exit 0,那么表示正常退出. 如果exit 10,也就是非0,那么就是异常退出. 然后这个test 标准为[]和 [[]]这样子 ...
- 重新点亮linux 命令树————服务管理工具[二十五]
前言 简单整理一下服务管理工具. 正文 服务集中管理工具. service 功能简单 systemctl 功能多 先来看下service脚本位置: 然后看下vim network 这里可以看到代码非常 ...
- 力扣481(java&python)-神奇字符串(中等)
题目: 神奇字符串 s 仅由 '1' 和 '2' 组成,并需要遵守下面的规则: 神奇字符串 s 的神奇之处在于,串联字符串中 '1' 和 '2' 的连续出现次数可以生成该字符串.s 的前几个元素是 s ...