使用批处理在腻子中输入第二个用户名和密码 [英] input second username and password in putty using batch

查看:63
本文介绍了使用批处理在腻子中输入第二个用户名和密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在初始登录成功后自动输入腻子中的用户名和密码.

I would like to know how to automate an input of username and password in putty after the initial login was successful.

我有一个蝙蝠文件connect.bat

@echo off

putty [user]@[host] -pw [password]

运行此命令后,它将打开一个新的腻子窗口并验证登录名.

After I run this, it opens a new putty window and validates the login.

成功后,我将不重定向到外壳,而是重定向到另一个登录屏幕.下面的示例.

When successful, I am redirected not to the shell but to another login screen. Sample below.

然后,我需要通过键入以下内容来手动输入其他用户名和密码.

Then I need to manually input a different username and password by typing the following.

[username]
[ENTER KEY]
[password]
[ENTER KEY]

要最终重定向到主持人的菜单.

To be finally redirected to the host's menu.

我尝试了以下操作:

echo [username] & [password] | putty [user]@[host] -pw [password] 

putty [user]@[host] -pw [password] < user_pass.txt
putty [user]@[host] -pw [password] -m user_pass.txt

但是失败了,是否可以通过批处理/powershell脚本来执行此操作,还是应该合并其他应用程序?

but failed, is there a way to perform this via batch/powershell script or should I incorporate another application?

推荐答案

您可以尝试

这篇关于使用批处理在腻子中输入第二个用户名和密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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