COMPLETED: - Phase 1: Proxmox host storage (/mnt/pve/oracle-backups/ROA/autobackup) - Phase 2: RMAN script already has CUMULATIVE keyword - Phase 3: Transfer scripts updated for Proxmox host * transfer_incremental.ps1: 10.0.20.37:22122 → 10.0.20.202:22 * transfer_to_dr.ps1: Same change * Converted Windows PowerShell to Linux bash commands - VM 109 cleanup: ~6.4 GB freed, RMAN catalog cleaned NEW FILES: - copy_existing_key_to_proxmox.ps1: Setup script for SSH key - setup_ssh_keys_for_proxmox.ps1: Alternative setup (not used) PENDING (Next Session): - Run copy_existing_key_to_proxmox.ps1 on PRIMARY as Administrator - Phase 4: Modify scheduled tasks (13:00 + 18:00) - Phase 5: Configure mount point on VM 109 (F:\ drive) - Phase 6: Update restore script for F:\ mount - Phase 7: Test FULL + CUMULATIVE backup and restore DOCUMENTATION: - DR_UPGRADE_TO_CUMULATIVE_PLAN.md: Added implementation status 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
90 lines
3.4 KiB
PowerShell
90 lines
3.4 KiB
PowerShell
# Setup SSH Keys for PRIMARY → Proxmox DR Transfer
|
|
# Rulează acest script MANUAL pe PRIMARY ca Administrator
|
|
#
|
|
# Acest script:
|
|
# 1. Generează chei SSH în profilul curent ($env:USERPROFILE\.ssh)
|
|
# 2. Copiază cheia publică pe Proxmox host (10.0.20.202)
|
|
# 3. Testează conexiunea SSH
|
|
|
|
param(
|
|
[string]$ProxmoxHost = "10.0.20.202",
|
|
[string]$ProxmoxUser = "root"
|
|
)
|
|
|
|
Write-Host "=========================================" -ForegroundColor Cyan
|
|
Write-Host "SSH Key Setup pentru PRIMARY → Proxmox DR" -ForegroundColor Cyan
|
|
Write-Host "=========================================" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
|
|
$SSHDir = "$env:USERPROFILE\.ssh"
|
|
$PrivateKeyPath = "$SSHDir\id_rsa"
|
|
$PublicKeyPath = "$SSHDir\id_rsa.pub"
|
|
|
|
# Verifică dacă cheia există deja
|
|
if (Test-Path $PrivateKeyPath) {
|
|
Write-Host "✓ SSH key deja există: $PrivateKeyPath" -ForegroundColor Green
|
|
Write-Host " Voi folosi cheia existentă." -ForegroundColor Yellow
|
|
} else {
|
|
Write-Host "→ Generez SSH key pair..." -ForegroundColor Yellow
|
|
|
|
# Creează directorul .ssh dacă nu există
|
|
if (-not (Test-Path $SSHDir)) {
|
|
New-Item -ItemType Directory -Path $SSHDir -Force | Out-Null
|
|
}
|
|
|
|
# Generează cheia SSH (fără parolă pentru automatizare)
|
|
& ssh-keygen.exe -t rsa -b 4096 -f $PrivateKeyPath -N '""' -C "PRIMARY-RMAN-to-Proxmox"
|
|
|
|
if ($LASTEXITCODE -eq 0) {
|
|
Write-Host "✓ Cheie SSH generată cu succes!" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "✗ Eroare la generarea cheii SSH" -ForegroundColor Red
|
|
exit 1
|
|
}
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "→ Citesc cheia publică..." -ForegroundColor Yellow
|
|
$PublicKey = Get-Content $PublicKeyPath -Raw
|
|
|
|
Write-Host "→ Copiez cheia publică pe Proxmox ($ProxmoxHost)..." -ForegroundColor Yellow
|
|
Write-Host " IMPORTANT: Vei fi întrebat de parola root pentru Proxmox!" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
|
|
# Copiază cheia publică pe Proxmox
|
|
$command = "mkdir -p /root/.ssh && chmod 700 /root/.ssh && echo '$PublicKey' >> /root/.ssh/authorized_keys && chmod 600 /root/.ssh/authorized_keys && echo 'SSH key adăugat cu succes!'"
|
|
|
|
& ssh "${ProxmoxUser}@${ProxmoxHost}" $command
|
|
|
|
if ($LASTEXITCODE -eq 0) {
|
|
Write-Host "✓ Cheie publică copiată pe Proxmox!" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "✗ Eroare la copierea cheii pe Proxmox" -ForegroundColor Red
|
|
Write-Host " Verifică dacă ai acces SSH la Proxmox cu parolă" -ForegroundColor Yellow
|
|
exit 1
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "→ Testez conexiunea SSH fără parolă..." -ForegroundColor Yellow
|
|
|
|
# Testează conexiunea
|
|
& ssh -o StrictHostKeyChecking=no -i $PrivateKeyPath "${ProxmoxUser}@${ProxmoxHost}" "echo 'SSH connection OK'"
|
|
|
|
if ($LASTEXITCODE -eq 0) {
|
|
Write-Host "✓ Conexiune SSH funcționează fără parolă!" -ForegroundColor Green
|
|
} else {
|
|
Write-Host "✗ Conexiunea SSH nu funcționează" -ForegroundColor Red
|
|
exit 1
|
|
}
|
|
|
|
Write-Host ""
|
|
Write-Host "=========================================" -ForegroundColor Green
|
|
Write-Host "✓ Setup complet!" -ForegroundColor Green
|
|
Write-Host "=========================================" -ForegroundColor Green
|
|
Write-Host ""
|
|
Write-Host "Cheia privată: $PrivateKeyPath" -ForegroundColor Cyan
|
|
Write-Host "Cheia publică: $PublicKeyPath" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
Write-Host "Scripturile de transfer vor folosi această cheie automat." -ForegroundColor Yellow
|
|
Write-Host ""
|