Oracle DR: Complete Phase 5 - NFS mount point configuration
Phase 5 implementation completed: - NFS server installed on Proxmox (nfs-kernel-server) - NFS export configured: /mnt/pve/oracle-backups → VM 109 - Windows NFS Client enabled in VM 109 - F:\ drive auto-mount at startup via scheduled task - PowerShell script: D:\Oracle\Scripts\mount-nfs.bat - Directory permissions set to 777 for Windows compatibility - Mount persists across VM reboots Files updated: - DR_UPGRADE_TO_CUMULATIVE_PLAN.md: Status → Phases 1-3-5 COMPLETED - Added detailed Phase 5 documentation with step-by-step setup - Updated validation checklist (8 items completed) Next: Phases 4, 6, 7 (scheduled tasks, restore script, testing) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Copy Existing SSH Key to Proxmox
|
||||
# Rulează acest script pe PRIMARY ca Administrator
|
||||
# Ruleaza acest script pe PRIMARY ca Administrator
|
||||
#
|
||||
# Acest script copiază cheia publică SSH existentă din profilul SYSTEM pe Proxmox
|
||||
# Acest script copiaza cheia publica SSH existenta din profilul SYSTEM pe Proxmox
|
||||
|
||||
param(
|
||||
[string]$ProxmoxHost = "10.0.20.202",
|
||||
@@ -9,7 +9,7 @@ param(
|
||||
)
|
||||
|
||||
Write-Host "=========================================" -ForegroundColor Cyan
|
||||
Write-Host "Copiere Cheie SSH Existentă → Proxmox DR" -ForegroundColor Cyan
|
||||
Write-Host "Copiere Cheie SSH Existenta -> Proxmox DR" -ForegroundColor Cyan
|
||||
Write-Host "=========================================" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
|
||||
@@ -17,62 +17,62 @@ $SystemSSHDir = "C:\Windows\System32\config\systemprofile\.ssh"
|
||||
$PublicKeyPath = "$SystemSSHDir\id_rsa.pub"
|
||||
$PrivateKeyPath = "$SystemSSHDir\id_rsa"
|
||||
|
||||
# Verifică dacă cheia există
|
||||
# Verifica daca cheia exista
|
||||
if (-not (Test-Path $PublicKeyPath)) {
|
||||
Write-Host "✗ Cheia publică nu există: $PublicKeyPath" -ForegroundColor Red
|
||||
Write-Host "X Cheia publica nu exista: $PublicKeyPath" -ForegroundColor Red
|
||||
Write-Host " Scriptul trebuie rulat ca Administrator!" -ForegroundColor Yellow
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "✓ Cheie publică găsită: $PublicKeyPath" -ForegroundColor Green
|
||||
Write-Host "OK Cheie publica gasita: $PublicKeyPath" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
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 "-> Copiez cheia publica pe Proxmox ($ProxmoxHost)..." -ForegroundColor Yellow
|
||||
Write-Host " IMPORTANT: Vei fi intrebat de parola root pentru Proxmox!" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
|
||||
# Metodă simplă: folosim SCP pentru a copia fișierul temporar, apoi cat
|
||||
# Metoda simpla: folosim SCP pentru a copia fisierul temporar, apoi cat
|
||||
$tempFile = "C:\Windows\Temp\temp_pubkey.pub"
|
||||
Copy-Item $PublicKeyPath $tempFile -Force
|
||||
|
||||
# Copiază fișierul pe Proxmox
|
||||
# Copiaza fisierul pe Proxmox
|
||||
& scp $tempFile "${ProxmoxUser}@${ProxmoxHost}:/tmp/temp_pubkey.pub"
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "✗ Eroare la copierea fișierului cu SCP" -ForegroundColor Red
|
||||
Write-Host "X Eroare la copierea fisierului cu SCP" -ForegroundColor Red
|
||||
Remove-Item $tempFile -Force -ErrorAction SilentlyContinue
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Adaugă cheia în authorized_keys
|
||||
# Adauga cheia in authorized_keys
|
||||
& ssh "${ProxmoxUser}@${ProxmoxHost}" "mkdir -p /root/.ssh; chmod 700 /root/.ssh; cat /tmp/temp_pubkey.pub >> /root/.ssh/authorized_keys; chmod 600 /root/.ssh/authorized_keys; rm /tmp/temp_pubkey.pub; echo 'SSH key added'"
|
||||
|
||||
Remove-Item $tempFile -Force -ErrorAction SilentlyContinue
|
||||
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "✓ Cheie publică copiată pe Proxmox!" -ForegroundColor Green
|
||||
Write-Host "OK Cheie publica copiata pe Proxmox!" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "✗ Eroare la adăugarea cheii în authorized_keys" -ForegroundColor Red
|
||||
Write-Host "X Eroare la adaugarea cheii in authorized_keys" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "→ Testez conexiunea SSH fără parolă..." -ForegroundColor Yellow
|
||||
Write-Host "-> Testez conexiunea SSH fara parola..." -ForegroundColor Yellow
|
||||
|
||||
# Testează conexiunea (cu cheia din profilul SYSTEM)
|
||||
# Testeaza conexiunea (cu cheia din profilul SYSTEM)
|
||||
$testResult = & ssh -o StrictHostKeyChecking=no -i $PrivateKeyPath "${ProxmoxUser}@${ProxmoxHost}" "echo 'SSH connection OK'" 2>&1
|
||||
|
||||
if ($LASTEXITCODE -eq 0) {
|
||||
Write-Host "✓ Conexiune SSH funcționează fără parolă!" -ForegroundColor Green
|
||||
Write-Host "OK Conexiune SSH functioneaza fara parola!" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "✗ Conexiunea SSH nu funcționează direct din acest cont" -ForegroundColor Yellow
|
||||
Write-Host " Dar cheia a fost adăugată - scheduled tasks (SYSTEM) ar trebui să funcționeze" -ForegroundColor Yellow
|
||||
Write-Host "X Conexiunea SSH nu functioneaza direct din acest cont" -ForegroundColor Yellow
|
||||
Write-Host " Dar cheia a fost adaugata - scheduled tasks (SYSTEM) ar trebui sa functioneze" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "=========================================" -ForegroundColor Green
|
||||
Write-Host "✓ Setup complet!" -ForegroundColor Green
|
||||
Write-Host "OK Setup complet!" -ForegroundColor Green
|
||||
Write-Host "=========================================" -ForegroundColor Green
|
||||
Write-Host ""
|
||||
Write-Host "Cheia din profilul SYSTEM: $PrivateKeyPath" -ForegroundColor Cyan
|
||||
Write-Host "Scheduled tasks vor folosi această cheie automat." -ForegroundColor Yellow
|
||||
Write-Host "Scheduled tasks vor folosi aceasta cheie automat." -ForegroundColor Yellow
|
||||
Write-Host ""
|
||||
|
||||
Reference in New Issue
Block a user