How To Generate Ssh Key For Git In Windows 7
Installing Git for Windows
- Download git for windows
- Run the downloaded installer and pay attention to the following settings
- You may prefer installing the git context menu, just I like to keep things simple so I merely unchecked it
- Choose "Use Git from the Windows control prompt"
- Choose "Checkout windows-style, commit Unix-mode line endings"
Installing SSH tools
The most common SSH windows utilities are the ones coming with Putty.
Downloading Putty binaries
First you need to go to Putty binaries repository and download the following resources:
- puttygen.exe
- plink.exe
- pageant.exe
Generating SSH keys
If you don't take a SSH public/private fundamental pair yous can generate information technology using the puttygen utility.
From now on I'll apply %USER_HOME% whenever I refer to your Windows user habitation binder, which depending on your Windows version may be located in:
Version | Path | ||
---|---|---|---|
Windows XP | C:\Documents and Settings\vlad | ||
Windows 7 and after | C:\Users\vlad | ||
You need to create a %USER_HOME%.ssh folder to shop your SSH private key.
mkdir .ssh
- Open puttygen and click Generate
- Copy the public fundamental to clipboard
- Go to your GitHub business relationship, open up the Account settings menu and navigate to the SSH Keys section. There you demand to paste your public key
- Add together a strong fundamental passphrase for securing your private primal usage and click "Save the private fundamental". You need to save it to the %USER_HOME%\.ssh folder.
You should now have a %USER_HOME%\.ssh\github-rsa.ppk file.
Setting up the SSH agent
- Create a shortcut of pageant.exe and save information technology in the Startup binder.
In Windows 10, y'all can access the Startup folder associated with your user account under this path:
C:\Users\%USERNAME%\AppData\Roaming\Microsoft\
Windows\Start Carte du jour\Programs\StartupMake certain the shortcut's target contains the path to your key as well.
C:\Putty\pageant.exe %USER_HOME%\.ssh\github-rsa.ppk
In society to set a parameter to a shortcut, yous can right-click the shortcut, cull Properties, and edit the Target text area to set the parameter you lot wish to transport to the shortcut executable.
- Run pageant and it should get to your System Tray
- Double-click the pageant System Tray icon
- Make sure the %USER_HOME%\.ssh\github-rsa.ppk individual key is listed
- Go to environment variables and add the GIT_SSH variable to reference the plink.exe organization path.
Setting upwardly your identity
Now, you need to set upwardly your username and email accost that will be used when issuing a commit:
$ git config --global user.name "Vlad Mihalcea" $ git config --global user.email postal service@vladmihalcea.com
Testing time
First, you lot need to establish a Plink connection, to make sure the SSH authentication works:
D:\kits\Putty>plink.exe -five git@github.com Looking up host "github.com" Connecting to 192.xxx.252.129 port 22 Server version: SSH-ii.0-libssh-0.6.0 Using SSH protocol version 2 We claim version: SSH-2.0-PuTTY_Release_0.63 Using Diffie-Hellman with standard group "group14" Doing Diffie-Hellman key exchange with hash SHA-one Host key fingerprint is: ssh-rsa 2048 xvi:27:air conditioning:a5:76:28:second:36:63:1b:56:4d:eb:df:a6:48 Initialised AES-256 SDCTR client->server encryption Initialised HMAC-SHA-256 client->server MAC algorithm Initialised AES-256 SDCTR server->client encryption Initialised HMAC-SHA-256 server->client MAC algorithm Pageant is running. Requesting keys. Pageant has i SSH-ii keys Using username "git". Trying Pageant key #0 Authenticating with public key "artsoft96" from agent Sending Pageant's response Admission granted Opening session as main channel Opened master channel Server refused to classify pty Started a trounce/command Server sent command exit status i Hi vladmihalcea! You've successfully authenticated, but GitHub does not provide trounce access. Disconnected: All channels closed
Now clone i of your GitHub repositories and play with git. Yous shouldn't exist asked for your username/password.
D:\vlad\GitHub>git clone git@github.com:vladmihalcea/db-util.git Cloning into 'db-util'... remote: Reusing existing pack: 213, washed. remote: Full 213 (delta 0), reused 0 (delta 0) Receiving objects: 100% (213/213), 150.94 KiB | 97.00 KiB/south, done. Resolving deltas: 100% (86/86), washed. Checking connectivity... done. D:\vlad\GitHub>cd db-util D:\vlad\GitHub\db-util>git commit -a -m "Change developer id to writer" [master 93ee2bf] Alter developer id to author 1 file changed, 1 insertion(+), 1 deletion(-) D:\vlad\GitHub\db-util>git push Counting objects: 7, done. Delta compression using upwardly to ii threads. Compressing objects: 100% (3/iii), done. Writing objects: 100% (3/3), 337 bytes | 0 bytes/due south, done. Total 3 (delta 2), reused 0 (delta 0) To git@github.com:vladmihalcea/db-util.git 21e9c0e..93ee2bf principal -> master
Source: https://vladmihalcea.com/tutorials/git/windows-git-ssh-authentication-to-github/
Posted by: formanyall1985.blogspot.com
0 Response to "How To Generate Ssh Key For Git In Windows 7"
Post a Comment