Hello All,
I have no experience with Unraid plugins, I would like some help with someone to create a Powershell plugin to allow the use Powershell Remoting via SSH.
I am able to install it locally, BUT after a reboot, the application goes away.
Any help, or direction how to create a plugin, would be greatly appreciated.
FYI, this would be perfect for an addition to NerdTools plugin.
INSTALL
## SOURCE https://docs.microsoft.com/en-us/powershell/scripting/install/install-other-linux?view=powershell-7.2
# Download the powershell '.tar.gz' archive
curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v7.2.2/powershell-7.2.2-linux-x64.tar.gz
# Create the target folder where powershell will be placed
sudo mkdir -p /opt/microsoft/powershell/7
# Expand powershell to the target folder
sudo tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/7
# Set execute permissions
sudo chmod +x /opt/microsoft/powershell/7/pwsh
# Create the symbolic link that points to pwsh
sudo ln -s /opt/microsoft/powershell/7/pwsh /usr/bin/pwsh
USING
At shell, type
pwsh
Remoting Customization
- Create SSH file
nano /boot/config/ssh/sshd_config
- Content:
PasswordAuthentication yes
PubkeyAuthentication yes
Subsystem powershell /usr/bin/pwsh -sshs -NoLogo
- Save file,
- Restart SSH
/etc/rc.d/rc.sshd restart
REMOTING FROM WINDOWS DESKTOP
$session = New-PSSession -HostName $hostname -UserName root
Id Name Transport ComputerName ComputerType State ConfigurationName Availability
-- ---- --------- ------------ ------------ ----- ----------------- ------------
4 Runspace3 SSH HOSTNAME RemoteMachine Opened DefaultShell Available
Invoke-Command -Session $session -ScriptBlock {hostname}
UNRAIDSERVER
With this, I would like to create a powershell module to control different aspects of the Unraid server.
Thanks.