The document shows the steps taken to generate an SSH key on a local machine and use it to connect to a GitHub repository. It demonstrates initializing a new Git repository locally, making an initial commit, connecting the local repository to a remote GitHub repository, and pushing the commit to GitHub. Authentication issues are encountered initially but resolved by providing login credentials.
1. Git bash
Welcome to Git (version 1.9.5-preview20150319)
Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.
anchal.chadha@BSSDT018 ~
$ pwd
/c/Users/anchal.chadha
anchal.chadha@BSSDT018 ~
$ mkdir .ssh
anchal.chadha@BSSDT018 ~
$ cd .ssh
anchal.chadha@BSSDT018 ~/.ssh
$ ssh-keygen -trsa -C"anchalchadha01@gmail.com"
Generating public/private rsa key pair.
Enter file in which to savethe key (/c/Users/anchal.chadha/.ssh/id_rsa):
Enter passphrase(empty for no passphrase):
Enter same passphraseagain:
Your identification has been saved in /c/Users/anchal.chadha/.ssh/id_rsa.
Your public key has been saved in /c/Users/anchal.chadha/.ssh/id_rsa.pub.
The key fingerprintis:
2. d3:5b:5b:1f:f7:cc:c4:8c:dc:e1:7b:e0:f6:0c:4d:15 anchalchadha01@gmail.com
The key's randomartimage is:
+--[ RSA 2048]----+
| E |
| .|
| ..|
| . ..=o|
| S . . =oB|
| . o + O=|
| . . +.B|
| . +.|
| o|
+-----------------+
anchal.chadha@BSSDT018 ~/.ssh
$ ssh -v git@github.com
OpenSSH_6.6.1, OpenSSL 1.0.1m19 Mar 2015
debug1: Connecting to github.com[192.30.252.131] port22.
debug1: Connection established.
debug1: identity file /c/Users/anchal.chadha/.ssh/id_rsa type1
debug1: identity file /c/Users/anchal.chadha/.ssh/id_rsa-certtype-1
debug1: identity file /c/Users/anchal.chadha/.ssh/id_dsa type -1
debug1: identity file /c/Users/anchal.chadha/.ssh/id_dsa-certtype-1
debug1: identity file /c/Users/anchal.chadha/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/anchal.chadha/.ssh/id_ecdsa-certtype-1
debug1: identity file /c/Users/anchal.chadha/.ssh/id_ed25519 type -1
3. debug1: identity file /c/Users/anchal.chadha/.ssh/id_ed25519-certtype-1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
debug1: Remote protocol version 2.0, remotesoftwareversion libssh-0.6.0
debug1: no match: libssh-0.6.0
debug1: SSH2_MSG_KEXINITsent
debug1: SSH2_MSG_KEXINITreceived
debug1: kex: server->client aes128-ctr hmac-sha1none
debug1: kex: client->server aes128-ctr hmac-sha1none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server hostkey: RSA 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
The authenticity of host'github.com (192.30.252.131)'can'tbe established.
RSA key fingerprintis 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sureyou wantto continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.252.131'(RSA) to the list of
know
n hosts.
debug1: ssh_rsa_verify: signaturecorrect
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUESTsent
debug1: SSH2_MSG_SERVICE_ACCEPTreceived
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
4. debug1: Offering RSA public key: /c/Users/anchal.chadha/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /c/Users/anchal.chadha/.ssh/id_dsa
debug1: Trying private key: /c/Users/anchal.chadha/.ssh/id_ecdsa
debug1: Trying private key: /c/Users/anchal.chadha/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).
anchal.chadha@BSSDT018 ~/.ssh
$ cd ..
anchal.chadha@BSSDT018 ~
$ cd ..
anchal.chadha@BSSDT018 /c/Users
$ cd..
sh.exe": cd..: command not found
anchal.chadha@BSSDT018 /c/Users
$ cd ..
anchal.chadha@BSSDT018 /c
$ cd C:anchalSanyamex2
anchal.chadha@BSSDT018 /c/anchal/Sanyam/ex2
$ pwd
5. /c/anchal/Sanyam/ex2
anchal.chadha@BSSDT018 /c/anchal/Sanyam/ex2
$ git init
Initialized empty Git repository in c:/anchal/Sanyam/ex2/.git/
anchal.chadha@BSSDT018 /c/anchal/Sanyam/ex2 (master)
$ Git add .
anchal.chadha@BSSDT018 /c/anchal/Sanyam/ex2 (master)
$ git commit -m"firstcommit"
[master (root-commit) fdfb91e] firstcommit
Committer: unknown <anchal.chadha@BSSDT018.betasoftsystems.com>
Your name and email address wereconfigured automatically based
on your usernameand hostname. Please check that they are accurate.
You can suppress this messageby setting them explicitly:
git config --global user.name"Your Name"
git config --global user.emailyou@example.com
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
5 files changed, 51 insertions(+)
create mode 100644 .classpath