You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Verified this is not an issues in the underlying windows container that should be reported to Windows Feedback Hub
Steps to reproduce
docker run --rm -it mcr.microsoft.com/powershell:lts-7.2-ubuntu-22.04 bash
root@container:/# pwsh -nop -c "& { Install-Module -Name 'PSWSMan' -AcceptLicense -Force -Scope AllUsers}"
root@container:/# pwsh -nop -c "& { Install-WSMan }"
root@container:/# pwsh
PS /> Enter-PSSession -ComputerName myserver -Credential (Get-Credential) -Authentication Negotiate
PowerShell credential request
Enter your credentials.
User: domain\myusername
Password for user domain\myusername: ***************
Enter-PSSession: Connecting to remote server myserver failed with the following error message : acquiring creds with username only failed No credentials were supplied, or the credentials were unavailable or inaccessible SPNEGO cannot find mechanisms to negotiate For more information, see the about_Remote_Troubleshooting Help topic.
### Actual behavior
```console
docker run --rm -it mcr.microsoft.com/powershell:lts-7.2-ubuntu-22.04 bash
root@container:/# pwsh -nop -c "& { Install-Module -Name 'PSWSMan' -AcceptLicense -Force -Scope AllUsers}"
root@container:/# pwsh -nop -c "& { Install-WSMan }"
root@container:/# pwsh
PS /> Enter-PSSession -ComputerName myserver -Credential (Get-Credential) -Authentication Negotiate
PowerShell credential request
Enter your credentials.
User: domain\myusername
Password for user domain\myusername: ***************
Enter-PSSession: Connecting to remote server myserver failed with the following error message : acquiring creds with username only failed No credentials were supplied, or the credentials were unavailable or inaccessible SPNEGO cannot find mechanisms to negotiate For more information, see the about_Remote_Troubleshooting Help topic.
NOTE
Running the following pwsh script in the container and restarting pwsh resolves the issue.
<#
.SYNOPSIS Enables support for legacy protocols in openssl which is needed for WinRM NTLM auth on Ubuntu 22.04
#>
[CmdletBinding()]
param()
$ErrorActionPreference = 'Stop'
Write-Host 'Enabling OpenSSL Legacy protocols...'
$opensslcnf = '/etc/ssl/openssl.cnf'
if (-not (Test-Path $opensslcnf)) { throw "Unable to find file: $opensslcnf" }
$content = Get-Content -Path $opensslcnf -Raw
$replacements = @(
[PSCustomObject]@{
regex = '\[provider_sect\]\s*\ndefault\s*=\s*default_sect\s*\n'
newText = "[provider_sect]`ndefault = default_sect`nlegacy = legacy_sect`n"
},
[PSCustomObject]@{
regex = '\[default_sect\]\s*\n\s*(#)*\s*activate\s*=\s*1\s*\n'
newText = "[default_sect]`nactivate = 1`n[legacy_sect]`nactivate = 1`n"
}
)
foreach ($replacement in $replacements) {
if (-not ($content -match $replacement.regex)) {
throw "Unable to find regex match for pattern: $($replacement.regex)"
}
$content = $content -replace $replacement.regex,$replacement.newText
}
$content | Out-File -Path '/etc/ssl/openssl.cnf' -NoNewline -Force
Prerequisites
Steps to reproduce
Expected behavior
NOTE
Running the following pwsh script in the container and restarting pwsh resolves the issue.
Environment data
Visuals
No response
The text was updated successfully, but these errors were encountered: