通过 Windows 命令提示符使用密码身份验证执行 ssh [英] Execute ssh with password authentication via windows command prompt

查看:25
本文介绍了通过 Windows 命令提示符使用密码身份验证执行 ssh的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过以非交互方式提供密码来从 windows 命令行 执行 ssh.我可以实现基于密钥的身份验证并能够像

I need to execute ssh from windows command line by providing password in a non interactive manner. I could implement the key based authentication and able to execute the ssh commands just like

ssh <user>@<host> <command>

有没有像

ssh <user>@<host> -P <password> <command>

不知道是否可行.但是,可以有一些解决方法.给我一些想法来完成同样的事情.

I don't know if it is feasible. However, there can be some work around for the same. Throw me some ideas to accomplish the same.

推荐答案

PuTTY 的 plink 有一个 密码的命令行参数.这个问题的答案中还提出了一些其他建议:使用 Expect(可用于 Windows),或编写一个在 Python 中使用 Paramiko 启动器.

PuTTY's plink has a command-line argument for a password. Some other suggestions have been made in the answers to this question: using Expect (which is available for Windows), or writing a launcher in Python with Paramiko.

这篇关于通过 Windows 命令提示符使用密码身份验证执行 ssh的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆