Sunday, 29 August 2021

PowerShell on Ubuntu

Commands to connect from Linux to Windows Server


Enter-PSSession -ComputerName <IPADDR> -Credential oneflorida\administrator -Authentication Negotiate

Invoke-Command -ComputerName  <IPADDR>  -ScriptBlock { get-ChildItem c:\ } -Credential oneflorida\administrator -Authentication Negotiate 


Install PowerShell

# Update the list of packages
sudo apt-get update
# Install pre-requisite packages.
sudo apt-get install -y wget apt-transport-https
# Download the Microsoft repository GPG keys
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
# Register the Microsoft repository GPG keys
sudo dpkg -i packages-microsoft-prod.deb
# Update the list of products
sudo apt-get update
# Enable the "universe" repositories
sudo add-apt-repository universe
# Install PowerShell
sudo apt-get install -y powershell
# Start PowerShell
pwsh
Fix one issues with the library
ldd /opt/microsoft/powershell/7/libmi.so
   linux-vdso.so.1 (0x00007fff9617c000)
   libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2a180a2000)
   libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2a1809c000)
   libpam.so.0 => /lib/x86_64-linux-gnu/libpam.so.0 (0x00007f2a1808a000)
   libssl.so.1.0.0 => not found
   libcrypto.so.1.0.0 => not found
   libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2a17e98000)
   /lib64/ld-linux-x86-64.so.2 (0x00007f2a182ad000)
   libaudit.so.1 => /lib/x86_64-linux-gnu/libaudit.so.1 (0x00007f2a17e6a000)
   libcap-ng.so.0 => /lib/x86_64-linux-gnu/libcap-ng.so.0 (0x00007f2a17e62000)
sudo ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.1 /lib/x86_64-linux-gnu/libssl.so.1.0.0
sudo ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
apt install gss-ntlmssp

No comments:

Post a Comment