Some checks failed
Test / test (push) Has been cancelled
Co-authored-by: Cursor <cursoragent@cursor.com>
3.9 KiB
3.9 KiB
Enable SSH on Proxmox Hosts
Status: Both servers have SSH port open but authentication is failing
Test Results
- ✅ ML110 (192.168.1.206): Network reachable, SSH port 22 open
- ✅ R630 (192.168.1.49): Network reachable, SSH port 22 open
- ❌ SSH Authentication: Failing (likely root login disabled or no SSH key)
Enable SSH Access
Option 1: Enable SSH via Proxmox Web UI (Easiest)
-
Access Proxmox Web UI:
- ML110: https://192.168.1.206:8006
- R630: https://192.168.1.49:8006
-
Enable SSH:
- Go to: Node → System → Services
- Find: ssh
- Click: Start (if not running)
- Click: Enable (to start on boot)
-
Allow Root Login:
- Go to: Node → System → Shell
- Run:
sed -i 's/#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config systemctl restart sshd
Option 2: Enable SSH via Console (Physical Access)
If you have physical/console access:
# Enable SSH service
systemctl enable ssh
systemctl start ssh
# Allow root login
sed -i 's/#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
systemctl restart sshd
# Verify
systemctl status ssh
Option 3: Enable SSH via API (If API Works)
Since API access is working, you could potentially enable SSH via API, but this is complex. The Web UI method is recommended.
Set Up SSH Key Authentication (Recommended)
Generate SSH Key (on your local machine)
ssh-keygen -t ed25519 -C "proxmox-access"
# Save to: ~/.ssh/id_ed25519_proxmox
Copy SSH Key to Proxmox Hosts
Option A: Using ssh-copy-id (after SSH is enabled)
ssh-copy-id -i ~/.ssh/id_ed25519_proxmox.pub root@192.168.1.206
ssh-copy-id -i ~/.ssh/id_ed25519_proxmox.pub root@192.168.1.49
Option B: Manual (via Web UI Shell)
-
Copy your public key:
cat ~/.ssh/id_ed25519_proxmox.pub -
On Proxmox host (via Web UI Shell):
mkdir -p ~/.ssh chmod 700 ~/.ssh echo "YOUR_PUBLIC_KEY_HERE" >> ~/.ssh/authorized_keys chmod 600 ~/.ssh/authorized_keys
Verify SSH Access
After enabling SSH:
# Test SSH
./scripts/utils/test-ssh-access.sh
# Or manually
ssh root@192.168.1.206 "hostname"
ssh root@192.168.1.49 "hostname"
Security Considerations
Allow Root Login (Less Secure)
# Edit SSH config
nano /etc/ssh/sshd_config
# Change:
# PermitRootLogin yes
# Restart SSH
systemctl restart sshd
Use SSH Key Only (More Secure)
# Disable password authentication
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
systemctl restart sshd
Use Sudo User Instead (Most Secure)
Create a non-root user with sudo:
# Create user
useradd -m -s /bin/bash proxmox-admin
usermod -aG sudo proxmox-admin
# Add SSH key
mkdir -p /home/proxmox-admin/.ssh
chmod 700 /home/proxmox-admin/.ssh
echo "YOUR_PUBLIC_KEY" >> /home/proxmox-admin/.ssh/authorized_keys
chmod 600 /home/proxmox-admin/.ssh/authorized_keys
chown -R proxmox-admin:proxmox-admin /home/proxmox-admin/.ssh
Troubleshooting
SSH Service Not Running
systemctl status ssh
systemctl start ssh
systemctl enable ssh
Firewall Blocking SSH
# Check firewall
iptables -L | grep 22
# Allow SSH (if needed)
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
Root Login Disabled
# Check current setting
grep PermitRootLogin /etc/ssh/sshd_config
# Enable root login
sed -i 's/#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
systemctl restart sshd
After SSH is Enabled
Once SSH access is working:
-
Recreate Template:
./scripts/troubleshooting/recreate-template-from-cloud-image.sh -
Or use manual steps:
- See:
docs/troubleshooting/TEMPLATE_RECREATION_MANUAL_STEPS.md
- See:
Current Status: SSH port is open but authentication is failing. Enable SSH and root login via Web UI or console.