The docs for GitHub show a command to create a key with the ed25519
encryption method which is not allowed by Xcode. Even if you are not using the Source Control features in Xcode you will often need to use an account with GitHub when you are consuming Swift packages which are pulled from GitHub.
For SSH keys there are 4 algorithms.
- 🚨 DSA: This is an older algorithm which is no longer supported and is superceded with more modern algorithms.
⚠️ RSA: This algorithm was an improvement but it is now outdated and a more modern method should be used.- 👀 ECDSA: Another improvement which is dependent on your computer's ability to generate random numbers.
- ✅ Ed25519: The most recommended public-key algorithm today which you should use with GitHub.
(Source)
Instead of the command shown in the docs, use ecdsa
which Xcode will accept. It can be done with the command below which will create a new key in a file named id_github
using the ed25519
algorithm. Use your own email for this key. If you already have a key you could move it into another folder or delete it as you won't be using it anymore.
ssh-keygen -o -a 100 -t ecdsa -f ~/.ssh/id_github -C "[email protected]"
Using id_github
for the name to makes it easier to identify the purpose for this key. Once the key is created run the ssh-agent.
eval "$(ssh-agent -s)"
Add the key to the Keychain with this command.
ssh-add --apple-use-keychain ~/.ssh/id_github
Once your new key is ready follow these steps to use it.
- Go to Settings on GitHub then to SSH and GPG keys
- Remove any keys you won't be using anymore
- Copy the contents of your new public key with this command:
pbcopy < ~/.ssh/id_github.pub
- Add the new key by pasting it in and use a unique label to identify it
- Go to Developer Settings then Personal Access Tokens
- Delete any unused tokens
- Add a new token with an expiration and copy the token
- Open Xcode then Preferences
- Go to accounts and remove the GitHub account
- Add back a GitHub account with your username and the token that was just copied
- Select
id_github
as the SSH key - See that Xcode accepts the new key and checks it with GitHub
- Open the Keychain app and search each keychain for
id_github
- Remove any old keys which will no longer be valid
Once these steps are completed you will be able to use Xcode with GitHub.
Hi Everyone,
I have facing the below issue while configuring the privateKey in my application, can someone please help me I am frustrated last 1 week to resole it please help someone
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'healthContributorRegistry' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointConfiguration.class]: Unsatisfied dependency expressed through method 'healthContributorRegistry' parameter 2: Error creating bean with name 'configServerHealthIndicator' defined in class path resource [org/springframework/cloud/config/server/config/EnvironmentRepositoryConfiguration$ConfigServerActuatorConfiguration.class]: Unsatisfied dependency expressed through method 'configServerHealthIndicator' parameter 0: Error creating bean with name 'searchPathCompositeEnvironmentRepository' defined in class path resource [org/springframework/cloud/config/server/config/CompositeConfiguration.class]: Unsatisfied dependency expressed through method 'searchPathCompositeEnvironmentRepository' parameter 0: Error creating bean with name 'defaultEnvironmentRepository' defined in class path resource [org/springframework/cloud/config/server/config/DefaultRepositoryConfiguration.class]: Unsatisfied dependency expressed through method 'defaultEnvironmentRepository' parameter 1: Error creating bean with name 'multipleJGitEnvironmentProperties': Could not bind properties to 'MultipleJGitEnvironmentProperties' : prefix=spring.cloud.config.server.git, ignoreInvalidFields=false, ignoreUnknownFields=true
2024-12-18T13:35:53.269Z INFO 1 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2024-12-18T13:35:53.440Z INFO 1 --- [ main] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2024-12-18T13:35:53.458Z ERROR 1 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
APPLICATION FAILED TO START
Description:
Binding to target org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.cloud.config.server.git' to org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentProperties failed:
Action:
Update your application's configuration
generated the private key using the below command
ssh-keygen -o -a 100 -t ecdsa -f ~/.ssh/id_github -C "[email protected]"
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -C "[email protected]"
Added the SSH key to gitgub
added private key in the Environment Variable
Please some save me
Thank You