【发布时间】:2017-10-05 17:33:57
【问题描述】:
我正在尝试创建一个 PowerShell 脚本以通过 SSH 连接到 Raspberry Pi 并执行一些命令。我正在使用 Plink 通过命令行通过 SSH 连接到 Pi。但是我必须通过 SSH 连接到在 lshell 中运行的 Pi 用户。我可以在零问题的情况下将 PuTTY 放入 Pi,但是在使用 Plink 时出现错误,提示我正在使用的命令被禁止。我正在尝试使用su,它在使用 PuTTY 而非 Plink 时有效。
我得到的错误如下:
plink : *** forbidden char/command over SSH: "su"
At line:1 char:1
+ plink -ssh pi@<IP> -pw <password> su
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (*** forbidden c... over SSH:
"su":String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
This incident has been reported.
感谢您提供的任何帮助。
【问题讨论】:
标签: powershell ssh raspberry-pi plink lshell