Step 1: Generate SSH Key Pair (Local Machine)
ssh-keygen -t ed25519 -C "your_email@example.com"Step 2: Copy Public Key to Server
ssh-copy-id username@YOUR_SERVER_IP -p PORTStep 3: Manual Copy (if ssh-copy-id fails)
cat ~/.ssh/id_ed25519.pub | ssh username@YOUR_SERVER_IP "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"Step 4: Set Correct Permissions
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keysStep 5: Test Login
ssh username@YOUR_SERVER_IP -p PORT