Gaston Paquette Posted March 26, 2022 Posted March 26, 2022 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. Quote
JonathanM Posted March 27, 2022 Posted March 27, 2022 16 hours ago, Gaston Paquette said: I am able to install it locally, BUT after a reboot, the application goes away. Unraid runs from RAM. The only persistent media is mounted at /boot (flash drive, don't write things there unnecessarily, people get upset if your plugin prematurely wears out their licensed flash stick), and any mounted pools and array drives in /mnt. Any modifications to the OS have to be reapplied on reboot. I suggest doing research on current plugins and how they operate, so you can see what is best practice when dealing with the somewhat unique Unraid ecosystem. Quote
xRadeon Posted March 5, 2023 Posted March 5, 2023 I've created a plugin that installs PowerShell for you if you still need it! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.