I am trying to create a PowerShell script to SSH into a Raspberry Pi and perform some commands. I am using Plink to SSH into the Pi over command line. However I have to SSH into the Pi user which runs in lshell. I can PuTTY into the Pi with zero issues, but when using Plink I get an error saying the command I am using is forbidden. I am trying to use su
which works when using PuTTY by not Plink.
The error I get is below:
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.
Thank you for any help you can provide.