sacspot.blogg.se

Vagrant ssh
Vagrant ssh





vagrant ssh

Netsh advfirewall firewall add rule name="SSHD" dir=in action=allow program="C:\Program Files\OpenSSH\usr\sbin\sshd.exe" enable=yes Netsh advfirewall firewall add rule name="SSHD" dir=in action=allow service=OpenSSHd enable=yes Set-Content C:\Windows\Temp\PATH (]] $env:PATH) -Encoding Byte Write-Output "Recording PATH for provisioners" # record the path for provisioners (without the newline) Set-Content C:\Users\vagrant\.ssh\environment $sshenv "CommonProgramW6432=C:\Program Files\Common Files" "CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files", ` $env_vars = "ProgramFiles(x86)=C:\Program Files (x86)", `

VAGRANT SSH 64 BIT

# add 64 bit environment variables missing from SSH Remove-Item -Recurse -Force -ErrorAction Silentl圜ontinue "C:\Program Files\OpenSSH\tmp"Ĭ:\Program` Files\OpenSSH\bin\junction.exe /accepteula "C:\Program Files\OpenSSH\tmp" "C:\Windows\Temp"Ĭ:\Windows\System32\icacls.exe "C:\Windows\Temp" /grant "vagrant:(OI)(CI)F" Write-Output "Setting temp directory location" Remove-Item -Force -ErrorAction Silentl圜ontinue "C:\Program Files\OpenSSH\etc\ssh_host_ed25519_key.pub" Remove-Item -Force -ErrorAction Silentl圜ontinue "C:\Program Files\OpenSSH\etc\ssh_host_ed25519_key" Write-Output "Removing ed25519 key as Vagrant net-ssh 2.9.1 does not support it" Set-Content "C:\Program Files\OpenSSH\etc\sshd_config" $sshd_config # next time OpenSSH starts have it listen on th eproper port $sshd_config = $sshd_config -replace 'Banner /etc/banner.txt', '#Banner /etc/banner.txt' $sshd_config = $sshd_config -replace '#UseDNS yes', 'UseDNS no' # disable the use of DNS to speed up the time it takes to establish a connection $sshd_config = $sshd_config -replace '#PermitUserEnvironment no', 'PermitUserEnvironment yes' $sshd_config = $sshd_config -replace '#PubkeyAuthentication yes', 'PubkeyAuthentication yes' $sshd_config = $sshd_config -replace 'StrictModes yes', 'StrictModes no' $sshd_config = Get-Content "C:\Program Files\OpenSSH\etc\sshd_config" Write-Output "Setting OpenSSH to be non-strict" Set-Content 'C:\Program Files\OpenSSH\etc\passwd' $passwd_file $passwd_file = $passwd_file -replace '/bin/bash', '/bin/sh' $passwd_file = Get-Content 'C:\Program Files\OpenSSH\etc\passwd' # Set shell to /bin/sh to return exit status Set-Content 'C:\Program Files\OpenSSH\etc\passwd' If (!(Test-Path "C:\Program Files\OpenSSH\bin\ssh.exe")) | by ssh-keygen -t rsa -C and openssh.ps1 is: $is_64bit = ::size -eq 8

vagrant ssh

Where vagrant_rsa and vagrant_rsa.pub is the private and public keys located in current vagrant project folder (and generated e.g. Add the following lines to your Vagrantfile: nfigure(2) do |config|Ĭ_key_path = "vagrant_rsa"Ĭonfig.vm.provision "shell", path: "openssh.ps1"Ĭonfig.vm.provision "file", source: "./vagrant_rsa.pub", destination: "~/.ssh/authorized_keys"







Vagrant ssh