Commit b4212a43 by César Galvis

feat: progress with ssh server and added more scripts

parent 5ce55f56
...@@ -78,6 +78,13 @@ Copy your `FortiClient` backup file in `./files` folder and follow these steps: ...@@ -78,6 +78,13 @@ Copy your `FortiClient` backup file in `./files` folder and follow these steps:
- In `System`, click the `Restore` button and select your backup file in `C:\vagrant\files` path - In `System`, click the `Restore` button and select your backup file in `C:\vagrant\files` path
- Add the backup file password and clic the `Ok` button - Add the backup file password and clic the `Ok` button
#### Enable proxy
```sh
# Run SOCKS5 tunnel
ssh -D 1080 -N -f vagrant@127.0.0.1 -p 2244
```
## Useful commands ## Useful commands
```sh ```sh
......
...@@ -14,24 +14,34 @@ Vagrant.configure("2") do |config| ...@@ -14,24 +14,34 @@ Vagrant.configure("2") do |config|
# boxes at https://vagrantcloud.com/search. # boxes at https://vagrantcloud.com/search.
config.vm.box = "gusztavvargadr/windows-11" config.vm.box = "gusztavvargadr/windows-11"
config.vm.box_version = "2302.0.2409" config.vm.box_version = "2302.0.2409"
config.vm.hostname = "windows-vpn"
# VM setup # VM setup
config.vm.provider "virtualbox" do |vb| config.vm.provider "virtualbox" do |vb|
vb.name = "Windows-VPN" vb.name = "Windows-vpn"
vb.memory = 1024 vb.memory = 1024
vb.cpus = 1 vb.cpus = 1
end end
# Enable SSH and SOCKS5 ports
config.vm.network "forwarded_port", guest: 22, host: 2244, id: "ssh"
config.vm.network "forwarded_port", guest: 1080, host: 1080, id: "socks5"
# Enable UI # Enable UI
config.vm.provider "virtualbox" do |vb| config.vm.provider "virtualbox" do |vb|
vb.gui = true vb.gui = true
end end
# Provisioning # Provisioning
## Run the external script to install SSH Server
config.vm.provision "shell", path: "src/scripts/SshServerInstall.ps1"
## Run the external script to enable SSH Server
config.vm.provision "shell", path: "src/scripts/SshServerEnable.ps1"
## Run the external script to install Chocolatey ## Run the external script to install Chocolatey
config.vm.provision "shell", path: "src/scripts/InstallChocolatey.ps1" config.vm.provision "shell", path: "src/scripts/ChocolateyInstall.ps1"
## Run the inline script to install forticlientvpn via Chocolatey ## Install Chocolatey packages
config.vm.provision "shell", inline: "choco install forticlientvpn --yes" config.vm.provision "shell", path: "src/scripts/ChocolateyInstallPackages.ps1"
# Disable automatic box update checking. If you disable this, then # Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs # boxes will only be checked for updates when the user runs
......
choco install forticlientvpn --yes
\ No newline at end of file
# Enable and start SSH Service
Start-Process powershell -ArgumentList "Start-Service sshd" -Verb RunAs
Set-Service -Name sshd -StartupType Automatic
# Add SSH firewall rule
New-NetFirewallRule -Name "SSH" -DisplayName "SSH" -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22
\ No newline at end of file
# Install OpenSSH
$sshFeature = Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server*'
if ($sshFeature.State -ne 'Installed') {
Write-Output "Installing OpenSSH Server..."
Add-WindowsCapability -Online -Name $sshFeature.Name
} else {
Write-Output "OpenSSH Server is already installed."
}
# Wait for the installation to finish and restart the machine
$restartNeeded = (Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Server*').RestartNeeded
if ($restartNeeded -eq $true) {
Write-Output "Restart to complete the OpenSSH installation..."
Restart-Computer -Force
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment