Move 150+ scripts from root and scripts/ into client/project directories: - clients/dataforth/scripts/ (110 files: AD2, sync, SSH, DB, DOS scripts) - clients/bg-builders/scripts/ (14 files: Lesley mgmt, Exchange, termination) - clients/internal-infrastructure/scripts/ (10 files: GDAP, Gitea, backups) - projects/msp-tools/scripts/ (9 files: CIPP, MSP onboarding, Datto) - projects/gururmm-agent/scripts/ (3 files: API test, JWT, record counts) - clients/glaztech/scripts/ (1 file: CentraStage removal) Also reorganized: - VPN scripts → infrastructure/vpn-configs/ - Retrieved API/JS files → api/ - Forum posts → projects/community-forum/forum-posts/ - SSH docs → clients/internal-infrastructure/docs/ - NWTOC/CTONW docs → projects/wrightstown-smarthome/docs/ - ACG website files → projects/internal/acg-website-2025/ - Dataforth docs → clients/dataforth/docs/ - schema-retrieved.sql → docs/database/ Deleted 24 tmp_*.ps1 one-off debug scripts (preserved in git history). Root reduced from 220+ files to 62 items (docs + directories only). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
102 lines
4.2 KiB
PowerShell
102 lines
4.2 KiB
PowerShell
# Check if OpenSSH client is available on AD2
|
|
$password = ConvertTo-SecureString "Paper123!@#" -AsPlainText -Force
|
|
$cred = New-Object System.Management.Automation.PSCredential("INTRANET\sysadmin", $password)
|
|
|
|
Write-Host "=== Checking OpenSSH Client Availability ===" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
|
|
Invoke-Command -ComputerName 192.168.0.6 -Credential $cred -ScriptBlock {
|
|
Write-Host "[1] OpenSSH Client Installation Status" -ForegroundColor Yellow
|
|
Write-Host "=" * 80 -ForegroundColor Gray
|
|
|
|
# Check if OpenSSH client is installed
|
|
$sshClient = Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH.Client*'
|
|
|
|
if ($sshClient) {
|
|
Write-Host "OpenSSH Client:" -ForegroundColor White
|
|
Write-Host " Name: $($sshClient.Name)" -ForegroundColor White
|
|
Write-Host " State: $($sshClient.State)" -ForegroundColor $(if ($sshClient.State -eq 'Installed') { "Green" } else { "Yellow" })
|
|
} else {
|
|
Write-Host "OpenSSH Client capability not found" -ForegroundColor Red
|
|
}
|
|
Write-Host ""
|
|
|
|
Write-Host "[2] Available SSH Commands" -ForegroundColor Yellow
|
|
Write-Host "=" * 80 -ForegroundColor Gray
|
|
|
|
# Check for ssh.exe
|
|
$sshPath = Get-Command ssh.exe -ErrorAction SilentlyContinue
|
|
if ($sshPath) {
|
|
Write-Host "[OK] ssh.exe found: $($sshPath.Source)" -ForegroundColor Green
|
|
$sshVersion = & ssh.exe -V 2>&1
|
|
Write-Host " Version: $sshVersion" -ForegroundColor Gray
|
|
} else {
|
|
Write-Host "[MISSING] ssh.exe not found" -ForegroundColor Red
|
|
}
|
|
|
|
# Check for scp.exe
|
|
$scpPath = Get-Command scp.exe -ErrorAction SilentlyContinue
|
|
if ($scpPath) {
|
|
Write-Host "[OK] scp.exe found: $($scpPath.Source)" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "[MISSING] scp.exe not found" -ForegroundColor Red
|
|
}
|
|
|
|
# Check for sftp.exe
|
|
$sftpPath = Get-Command sftp.exe -ErrorAction SilentlyContinue
|
|
if ($sftpPath) {
|
|
Write-Host "[OK] sftp.exe found: $($sftpPath.Source)" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "[MISSING] sftp.exe not found" -ForegroundColor Red
|
|
}
|
|
Write-Host ""
|
|
|
|
Write-Host "[3] Current PuTTY Tools" -ForegroundColor Yellow
|
|
Write-Host "=" * 80 -ForegroundColor Gray
|
|
|
|
# Check existing PuTTY tools
|
|
$pscpPath = "C:\Program Files\PuTTY\pscp.exe"
|
|
$plinkPath = "C:\Program Files\PuTTY\plink.exe"
|
|
|
|
if (Test-Path $pscpPath) {
|
|
Write-Host "[CURRENT] pscp.exe: $pscpPath" -ForegroundColor Cyan
|
|
$pscpVersion = & $pscpPath -V 2>&1 | Select-Object -First 1
|
|
Write-Host " $pscpVersion" -ForegroundColor Gray
|
|
}
|
|
|
|
if (Test-Path $plinkPath) {
|
|
Write-Host "[CURRENT] plink.exe: $plinkPath" -ForegroundColor Cyan
|
|
}
|
|
Write-Host ""
|
|
|
|
Write-Host "[4] Test SCP Transfer (if available)" -ForegroundColor Yellow
|
|
Write-Host "=" * 80 -ForegroundColor Gray
|
|
|
|
if ($scpPath) {
|
|
# Create a test file
|
|
$testFile = "C:\Shares\test\scripts\openssh-test.txt"
|
|
"OpenSSH SCP Test - $(Get-Date)" | Out-File -FilePath $testFile -Encoding ASCII
|
|
|
|
Write-Host "Created test file: $testFile" -ForegroundColor White
|
|
Write-Host "Ready to test SCP transfer to NAS" -ForegroundColor Green
|
|
Write-Host ""
|
|
Write-Host "Test command would be:" -ForegroundColor Yellow
|
|
Write-Host " scp -v $testFile root@192.168.0.9:/data/test/scripts/" -ForegroundColor Gray
|
|
Write-Host ""
|
|
Write-Host "Benefits vs PuTTY pscp:" -ForegroundColor Cyan
|
|
Write-Host " - Native error messages" -ForegroundColor White
|
|
Write-Host " - SSH key support (no passwords in scripts)" -ForegroundColor White
|
|
Write-Host " - Verbose logging with -v flag" -ForegroundColor White
|
|
Write-Host " - Better batch mode handling" -ForegroundColor White
|
|
Write-Host " - StrictHostKeyChecking=accept-new (auto-accept on first connect)" -ForegroundColor White
|
|
} else {
|
|
Write-Host "OpenSSH client not available - would need to install" -ForegroundColor Red
|
|
Write-Host ""
|
|
Write-Host "Install command:" -ForegroundColor Yellow
|
|
Write-Host " Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0" -ForegroundColor Gray
|
|
}
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "=== Check Complete ===" -ForegroundColor Cyan
|