【发布时间】:2021-03-31 13:59:14
【问题描述】:
我在尝试让我的批处理文件同时在 PuTTY/Plink 中授予我超级用户访问权限时遇到了麻烦。我可以自动输入 ip 和密码,但我还想将它自动化到当我运行这个批处理文件时它也会给我su 访问权限的地方。到目前为止,它运行到我需要手动输入su 的地步,但我正在尝试自动化,所以我尝试了-m commands.txt,现在它只是崩溃了。在这里寻求任何帮助,谢谢。
这是我目前所拥有的
@echo off
color b
cls
echo What is the IP for the unit?:
set /p IP= :
echo What is the SSH Password for this unit?:
set /p Passw0rd= :
echo What is the Root Password for this unit?:
set /p ro0t= :
start plink.exe -ssh user@%IP% -pw %Passw0rd% -m commands.txt
exit/b
commands.txt 中的内容:
su
【问题讨论】:
标签: batch-file ssh putty plink