Python paramiko 报错 paramiko.ssh_exception.SSHException: not a valid RSA private key file
报错的原因是选择的文件不是一个有效的 RSA 密钥文件
现在通过 ssh-keygen 默认生成的密钥文件是新的格式,并非 RSA 格式。打开文件可以看到是以 -----BEGIN OPENSSH PRIVATE KEY----- 开头的,模块无法识别。
解决方法
生成时指定格式:
通过 ssh-keygen -m PEM -t rsa 命令生成 RSA 格式的密钥对
ssh-keygen 参数
-m:参数指定密钥的格式,PEM(也就是 RSA 格式)是之前使用的旧格式
-b:指定密钥长度
-e:读取openssh的私钥或者公钥文件
-C:添加注释
-f:指定用来保存密钥的文件名
-i:读取未加密的ssh-v2兼容的私钥/公钥文件,然后在标准输出设备上显示openssh兼容的私钥/公钥
-l:显示公钥文件的指纹数据
-N:提供一个新密语
-P:提供(旧)密语
-q:静默模式
-t:指定要创建的密钥类型
Python paramiko 报错 paramiko.ssh_exception.SSHException: not a valid RSA private key file的更多相关文章
- mac 上python编译报错No module named MySQLdb
mac 上python编译报错No module named MySQLdb You installed python You did brew install mysql You did expor ...
- 调用python脚本报错/usr/bin/env: python : No such file or directory
一.调用python脚本报错 /usr/bin/env: python: No such file or directory 二.解决方法 原因是在windows上编写的脚本,使用dos2unix对脚 ...
- 第一次打开pycharm运行python文件报错”No Python interpreter selected“问题的解决办法
前面没有细讲,这里细述一下安装pycharm后,第一次打开pycharm运行python文件报错"No Python interpreter selected"问题的解决办法. 出 ...
- CentOS中输入yum报错:sudo: unable to execute /bin/yum: No such file or directory
今天尝试更新了下虚拟机CentOS中的python版本后. 运行“yum”命令,就报错:“sudo: unable to execute /bin/yum: No such file or direc ...
- mysql启动报错:Starting MySQL...The server quit without updating PID file
在mysql的data目录下误删除了mysql-bin.000001,mysql-bin.000002等文件,但是没有删除mysql-bin.index文件,此时启动mysql就会报错: Starti ...
- EL表达式报错: According to TLD or attribute directive in tag file, attribute value does not accept any expressions
EL表达式报错: According to TLD or attribute directive in tag file, attribute value does not accept any ex ...
- 使用jstl报错:According to TLD or attribute directive in tag file, attribute value does not accept any expressions
使用jstl报错:According to TLD or attribute directive in tag file, attribute value does not accept any ex ...
- 解决 php 报错 open_basedir restriction in effect或者nginx提示No input file specified怎么办
解决 php 报错 open_basedir restriction in effect或者nginx提示No input file specified怎么办 问题是出现在了PHP.INI上面了 ,原 ...
- 使用jstl标签报错:According to TLD or attribute directive in tag file, attribute value
原来jstl标签版本不一样,标签支持不一样. jstl1.0标签库不支持表达式,如: <c:if test="${query01 == null}"> <js ...
随机推荐
- 创意编程,Python开发多功能壁纸自动切换工具!
import ctypes import time import requests import os from threading import Thread from tkinter import ...
- 纯js的统计图插件-统计图
第一次写博客,写的不到望大家见谅! 今天给大家分享一个纯js的插件(统计图),有知道的可以在下面评论一起谈论一下,刚学着的时候,我是看了好久才看懂的一个基本结构,到后来我才知道原来直接去原网站上找到复 ...
- 点云3D 目标检测
点云 点云是雷达采集到的信息. 关于点云基本介绍参考https://zhuanlan.zhihu.com/p/22581673 ros中的点云消息结构:http://docs.ros.org/jade ...
- Java学习笔记 DbUtils数据库查询和log4j日志输出 使用
DbUtils使用 QueryRunner DbUtils中定义了一个数据库操作类QueryRunner,所有的数据库操作CRUD都是通过此类来完成. 此类是线程安全的 方法名 对应sql语句 exc ...
- Koa 中间件的执行
Node.js 中请求的处理 讨论 Koa 中间件前,先看原生 Node.js 中是如何创建 server 和处理请求的. node_server.js const http = require(&q ...
- WPF 程序员休息数字时钟
由于,程序员工作压力较大,上周996.ICU项目也非常火,为了让程序员开发者注重休息,特意写了一个休眠时钟,启动程序默认会倒计时3分钟. 效果图: 程序支持自定义休息时间,通过命令行参数执行,例如: ...
- collection(list,set,map)集合详解
一:java集合的体系结构如下: Java集合大致分为Set.List.Queue.Map四个体系 .Collection: List和Set,Queue继承自Collection接口. |--Lis ...
- FCC---Learn How Bezier Curves Work---定义坐标轴点的值,影响斜率,改变速度。具体调试换值既可以体会
The last challenge introduced the animation-timing-function property and a few keywords that change ...
- iOS音频与视频的开发(一)-使用AVAudioPlayer播放音乐、使用AVPlayerViewController播放视频
iOS的多媒体支持非常强大,它提供了多套支持多媒体的API,无论是音频.视频的播放,还是录制,iOS都提供了多种API支持.借助于这些API的支持,iOS应用既可以查看.播放手机相册中的照片.视频,也 ...
- 一语点醒技术人:你不是 Google(转载)
转载链接:https://www.infoq.cn/article/2017/06/U-no-Google 在为问题寻找解决方案时要先充分了解问题本身,而不是一味地盲目崇拜那些巨头公司.Ozan On ...