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

查看:1912
本文介绍了通过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)或撰写使用Paramiko在Python中启动。

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天全站免登陆