2026-08-17 01:05
Status:
Tags: Git Github Version Control Tools Programming Programming Concepts IBM Full Stack Software Developer Professional Certificate IBM IBM - Getting Started with Git and Github
IBM - GSGG - Module 3 & 4 - Creating SSH Key and Token
==Generating a Token for Github Authorization
Exercise 1: Generate personal access token
Let’s first create a personal access token that you will use as a password with pushing code back to GitHub.com
- Open GitHub.com. In the upper-right corner of any page, click your profile photo, then click Settings.

-
Next, select Developer settings. This option is typically available towards the bottom of the window.

-
Navigate to Tokens (classic) under Personal access tokens.

-
To generate an access token, click Generate a personal access token.

-
In the Generate token page, fill in the required details and click the repo checkbox to enable access for
gitcommands.
-
Then, click Generate token.

-
Your personal access token will be generated. The token is only valid for 30 days. You will need to generate a new token once the current token expires.
REMEMBER: Make sure to copy your personal access token now. You won’t be able to see it again!
==Generating an SSH Key for authentication
Generating an SSH key
To generate an SSH key, complete the following steps:
-
Launch a terminal. If you are using Windows, launch Git Bash.
-
Type the following command in your terminal, replacing
with the email address that is linked to your Github account. When you have typed the command, press Enter. -
1
-
ssh-keygen -t rsa -b 4096 -C "<your email address>"
Copied!Wrap Toggled!
A new SSH key is generated.
-
-
You will be prompted to enter a directory to save the key. You can simply press Enter to accept the default location, which is an .ssh folder in the home directory. This means you will be able to locate the key in
~/.ssh/id_rsa. -
You will be prompted to choose a passphrase. You also have the option not to create a passphrase. To skip the passphrase, press Enter twice to confirm that the passphrase is empty.
-
Optional: To navigate to the .ssh directory, and check the contents of the directory, run the following commands in the terminal:
-
1
-
cd ~/.ssh
Copied!Wrap Toggled!
and then,
-
1
-
ls
Copied!Wrap Toggled!
When you list the contents of the .ssh directory, you should see
id_rsaandid_rsa.pubin the list of contents, whereid_rsais the private version of your key andid_rsa.pubis the public version of your key. -
-
You now need to add the SSH key to the ssh-agent, which helps with the authentication process. To start the ssh-agent, run the following command in the terminal:
-
1
-
eval "$(ssh-agent -s)"
Copied!Wrap Toggled!
-
-
To add the key to the agent, run the following command in the terminal:
-
1
-
ssh-add ~/.ssh/id_rsa
Copied!Wrap Toggled!
-
-
Please find Screenshot for reference:
