-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_ssh.sh
More file actions
executable file
·30 lines (26 loc) · 1.21 KB
/
setup_ssh.sh
File metadata and controls
executable file
·30 lines (26 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# Script for generating SSH keys in the panel container
echo "🔑 Generating SSH keys for Server Panel..."
echo ""
# Create directory for keys
docker exec serverpanel-app mkdir -p /root/.ssh
docker exec serverpanel-app chmod 700 /root/.ssh
# Generate key
docker exec serverpanel-app ssh-keygen -t rsa -b 4096 -f /root/.ssh/id_rsa -N ""
echo ""
echo "✅ SSH key successfully created!"
echo ""
echo "📋 Your public key (copy it):"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
docker exec serverpanel-app cat /root/.ssh/id_rsa.pub
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "📝 Add this key to your servers:"
echo " ssh user@your-server"
echo " echo 'YOUR_PUBLIC_KEY' >> ~/.ssh/authorized_keys"
echo " chmod 600 ~/.ssh/authorized_keys"
echo ""
echo "🎯 Then specify in server settings:"
echo " - SSH user: root (or your user)"
echo " - SSH port: 22"
echo " - Key path: /root/.ssh/id_rsa"