Cyberpanel You are not authorized to access this resource

I am new to Cyberpanel and would like to integrate it with my existing github repo but I get You are not authorized to access this resource. when I try manage git on cyberpanel user interface. I tried following following docs and added the new ssh key to github but again it’s not connected.

Tech stack:

  • AWS Cyberpanel 2.1 with Ubuntu OS
  • Github public repo for test

Integrating CyberPanel with your GitHub repository can sometimes be tricky, especially when it comes to SSH key configuration. Here are some steps to troubleshoot the “not authorized” error:

  1. SSH Key Generation: Make sure you’ve generated an SSH key on your CyberPanel server. You can do this by running:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

Follow the prompts and ensure the key is saved, typically in ~/.ssh/id_rsa.
2. Add SSH Key to GitHub: Copy the public key to your clipboard:

cat ~/.ssh/id_rsa.pub

Go to GitHub, navigate to Settings > SSH and GPG keys, and add a new SSH key. Make sure you paste the entire public key.
3. Test SSH Connection: Test if your server can connect to GitHub:

ssh -T git@github.com

If it’s successful, you should see a message like “You’ve successfully authenticated…”
4. Ensure Correct Permissions: Make sure the .ssh directory and the key files have the right permissions:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
  1. Use the Correct Git URL: Ensure you’re using the SSH URL for your repository in CyberPanel, which looks like git@github.com:username/repo.git.
  2. Restart CyberPanel: After making changes, it’s a good idea to restart CyberPanel to ensure all configurations are refreshed:
systemctl restart lscpd
  1. Check CyberPanel Logs: If the issue persists, check the CyberPanel logs for any specific error messages that might provide more insight:
tail -f /var/log/lscpd.log
  1. Verify CyberPanel User: Make sure you are logged into CyberPanel as a user that has permissions to manage Git.

If you’ve followed all these steps and are still encountering issues, consider reaching out to CyberPanel’s support forums for more tailored assistance.