Friday, 31 October 2025

Git - Create git account , install git and configure ssh authentication

In this demonstration we will install git on Oracle Enterprise Linux 9.5

First, create a free account on GitHub. During sign-up, you will be required to provide an email address and a unique username."

I have created my github account with email mahekarthya@gmail.com and username as mahekarthya

Install git on OEL 9.5

[root@devopsvm01 ~]# cat /etc/oracle-release

Oracle Linux Server release 9.5

[root@devopsvm01 ~]#

[root@devopsvm01 ~]# git --version

bash: git: command not found...

Install package 'git-core' to provide command 'git'? [N/y] N

[root@devopsvm01 ~]#


[root@devopsvm01 ~]# dnf install git -y

Last metadata expiration check: 0:16:04 ago on Sun 02 Nov 2025 08:39:34 AM IST.

Dependencies resolved.

=====================================================================================================================================================================================

 Package                                       Architecture                        Version                                          Repository                                  Size

=====================================================================================================================================================================================

Installing:

 git                                           x86_64                              2.47.3-1.el9_6                                   ol9_appstream                               65 k

Installing dependencies:

 git-core                                      x86_64                              2.47.3-1.el9_6                                   ol9_appstream                              4.7 M

 git-core-doc                                  noarch                              2.47.3-1.el9_6                                   ol9_appstream                              4.1 M

 perl-Error                                    noarch                              1:0.17029-7.el9                                  ol9_appstream                               57 k

 perl-Git                                      noarch                              2.47.3-1.el9_6                                   ol9_appstream                               42 k

 perl-TermReadKey                              x86_64                              2.38-11.el9                                      ol9_appstream                               42 k

 perl-lib                                      x86_64                              0.65-481.1.el9_6                                 ol9_appstream                               13 k


Transaction Summary

=====================================================================================================================================================================================

Install  7 Packages

Total download size: 9.0 M

Installed size: 40 M

Downloading Packages:

(1/7): git-2.47.3-1.el9_6.x86_64.rpm                                                                                                                 427 kB/s |  65 kB     00:00

(2/7): perl-Error-0.17029-7.el9.noarch.rpm                                                                                                           453 kB/s |  57 kB     00:00

(3/7): perl-Git-2.47.3-1.el9_6.noarch.rpm                                                                                                            1.5 MB/s |  42 kB     00:00

(4/7): perl-TermReadKey-2.38-11.el9.x86_64.rpm                                                                                                       1.6 MB/s |  42 kB     00:00

(5/7): perl-lib-0.65-481.1.el9_6.x86_64.rpm                                                                                                          599 kB/s |  13 kB     00:00

(6/7): git-core-2.47.3-1.el9_6.x86_64.rpm                                                                                                            5.4 MB/s | 4.7 MB     00:00

(7/7): git-core-doc-2.47.3-1.el9_6.noarch.rpm                                                                                                        4.0 MB/s | 4.1 MB     00:01

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Total                                                                                                                                                8.6 MB/s | 9.0 MB     00:01

Running transaction check

Transaction check succeeded.

Running transaction test

Transaction test succeeded.

Running transaction

  Preparing        :                                                                                                                                                             1/1

  Installing       : git-core-2.47.3-1.el9_6.x86_64                                                                                                                                                  1/7

  Installing       : git-core-doc-2.47.3-1.el9_6.noarch                                                                                                                                              2/7

  Installing       : perl-lib-0.65-481.1.el9_6.x86_64                                                                                                                                                3/7

  Installing       : perl-TermReadKey-2.38-11.el9.x86_64                                                                                                                                             4/7

  Installing       : perl-Error-1:0.17029-7.el9.noarch                                                                                                                                               5/7

  Installing       : perl-Git-2.47.3-1.el9_6.noarch                                                                                                                                                  6/7

  Installing       : git-2.47.3-1.el9_6.x86_64                                                                                                                                                       7/7

  Running scriptlet: git-2.47.3-1.el9_6.x86_64                                                                                                                                                       7/7

  Verifying        : git-2.47.3-1.el9_6.x86_64                                                                                                                                                       1/7

  Verifying        : git-core-2.47.3-1.el9_6.x86_64                                                                                                                                                  2/7

  Verifying        : git-core-doc-2.47.3-1.el9_6.noarch                                                                                                                                              3/7

  Verifying        : perl-Error-1:0.17029-7.el9.noarch                                                                                                                                               4/7

  Verifying        : perl-Git-2.47.3-1.el9_6.noarch                                                                                                                                                  5/7

  Verifying        : perl-TermReadKey-2.38-11.el9.x86_64                                                                                                                                             6/7

  Verifying        : perl-lib-0.65-481.1.el9_6.x86_64                                                                                                                                                7/7

Installed:

  git-2.47.3-1.el9_6.x86_64                 git-core-2.47.3-1.el9_6.x86_64         git-core-doc-2.47.3-1.el9_6.noarch       perl-Error-1:0.17029-7.el9.noarch       perl-Git-2.47.3-1.el9_6.noarch

  perl-TermReadKey-2.38-11.el9.x86_64       perl-lib-0.65-481.1.el9_6.x86_64

Complete!

[root@devopsvm01 ~]#

Verify the git version.

[root@devopsvm01 ~]# git --version

git version 2.47.3

[root@devopsvm01 ~]#



Configure git for your OS.

1. Configure your name 

[root@devopsvm01 ~]# git config --global user.name
[root@devopsvm01 ~]#
[root@devopsvm01 ~]# git config --global user.name "mahekarthya"
[root@devopsvm01 ~]#
[root@devopsvm01 ~]# git config --global user.name
mahekarthya
[root@devopsvm01 ~]#


user.name records who made a specific commit. Every time you run git commit, the value set by this configuration is used as the author name for that commit. This is crucial for tracking who did what in a project's history.

2. Configure your email

[root@devopsvm01 ~]# git config --global user.email
[root@devopsvm01 ~]#
[root@devopsvm01 ~]# git config --global user.email "mahekarthya@gmail.com"
[root@devopsvm01 ~]#
[root@devopsvm01 ~]# git config --global user.email
mahekarthya@gmail.com
[root@devopsvm01 ~]#

Without both a user.name and a user.email configured, Git will not allow you to make commits and will prompt you to set them.

Setup SSH authentication from the local machine to github

Using SSH authentication for GitHub is a secure and convenient way to interact with your repositories without providing your username and Personal Access Token (or password) every time.

The process involves creating a public/private key pair on your local machine and then uploading the public key to your GitHub account.

To create public/private key pair we use,

ssh-keygen -t ed25519 -C "your-email-id"

-t ed25519 The type flag (-t) specifies the encryption algorithm. ed25519 is a modern, highly secure, and fast elliptic curve cryptography algorithm.

-C "your-email-id"The comment flag (-C) adds a descriptive label to the key.

[root@devopsvm01 ~]#  ssh-keygen -t ed25519 -C "mahekarthya@gmail.com"

Generating public/private ed25519 key pair.

Enter file in which to save the key (/root/.ssh/id_ed25519):

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /root/.ssh/id_ed25519

Your public key has been saved in /root/.ssh/id_ed25519.pub

The key fingerprint is:

SHA256:ze9xwRCHBSl8IHks9q8ZOn2GxwPVbcCA6tl3315h8Uk mahekarthya@gmail.com

The key's randomart image is:

+--[ED25519 256]--+

|        .+.o+Bo  |

|        +.* +oo  |

|       . = o.. E |

|        .o. .oo *|

|       .Sooo  o=.|

|        o +.o o..|

|         o Oo...o|

|        o =.*o  +|

|         . +.. ..|

+----[SHA256]-----+

[root@devopsvm01 ~]#

[root@devopsvm01 ~]# cd /root/.ssh

[root@devopsvm01 .ssh]# ls -lrt

total 16

-rw-r--r--. 1 root root  95 Nov  1 19:50 known_hosts.old

-rw-------. 1 root root 270 Nov  1 19:50 known_hosts

-rw-r--r--. 1 root root 103 Nov  2 08:58 id_ed25519.pub

-rw-------. 1 root root 411 Nov  2 08:58 id_ed25519

[root@devopsvm01 .ssh]#


Note down the public key.

[root@devopsvm01 .ssh]# cat id_ed25519.pub

ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGW2ndC2wL0f8kgzs2JBdJVyDkgezI7zar+nbA1qS+98 mahekarthya@gmail.com

[root@devopsvm01 .ssh]#


Now copy the public key content and update it in the github.com account.

Go to setting tab,






Click on SSH and GPG Keys.




























Under SSH , click on new SSH key 












Now add your public key here.































































 




















Verify the SSH authentication 

[root@devopsvm01 .ssh]# ssh -T git@github.com
Hi mahekarthya! You've successfully authenticated, but GitHub does not provide shell access.
[root@devopsvm01 .ssh]#


-T: This option tells SSH not to allocate a pseudo-terminal. For this specific test with GitHub, this is an important flag because you are not trying to execute an interactive shell session, just authenticating.

Building a Safer PostgreSQL CI/CD Pipeline with GitHub Actions: Dev → PR Review → Test Promotion

In my previous post, we explored a simple push-to-main deployment strategy . While functional, that model is not considered an industry best...