Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion to use enrypted winrm #24

Open
diseq opened this issue Jul 3, 2015 · 2 comments
Open

Suggestion to use enrypted winrm #24

diseq opened this issue Jul 3, 2015 · 2 comments

Comments

@diseq
Copy link

diseq commented Jul 3, 2015

just a suggestion, as we use ssh it might be nice to use encrypted winrm. i use following script in my boxes. maybe thats something to integrate: (the only thing woul be to recreate certificate on vagrant up (in tpl file)

& "$PSScriptRoot\makecert" -sk "$env:COMPUTERNAME" -ss My -sr localMachine -r -n "CN=$env:COMPUTERNAME" -a sha1 -eku "1.3.6.1.5.5.7.3.1"
$thumbprint = ((Get-ChildItem -Path cert:\LocalMachine\My | Where-Object {$_.Subject -eq "CN=$env:COMPUTERNAME"}) | Select-Object -first 1).Thumbprint
winrm create winrm/config/listener?Address=*+Transport=HTTPS "@`{Hostname=`"$env:COMPUTERNAME`";CertificateThumbprint=`"$thumbprint`";Port=`"5986`"`}"

net stop winrm
net start winrm

netsh advfirewall firewall add rule name="Windows Remote Management (HTTPS-In)" dir=in action=allow protocol=TCP localport=5986

btw. thanks for the great work!

@diseq
Copy link
Author

diseq commented Jul 3, 2015

by trying the winrm version with vmware provider i receive follwing error: (seems to connect no nonssl winrm with ssl winrm)

 INFO winrmshell: Attempting to connect to WinRM (patched)...
 INFO winrmshell:   - Host: 192.168.240.134
 INFO winrmshell:   - Port: 5985
 INFO winrmshell:   - Username: vagrant
 INFO winrm: WinRM not up: #<VagrantPlugins::CommunicatorWinRM::Errors::ExecutionError: An error occurred executing a remote WinRM command.

Shell: powershell
Command: hostname
if ($?) { exit 0 } else { if($LASTEXITCODE) { exit $LASTEXITCODE } else { exit 1 } }
Message: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol>

@juju4
Copy link

juju4 commented Feb 18, 2016

would be great addition! +1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants