25978

SSH key not working on git bash after closing and opening new

Question:

Have create ssh key using following link (<a href="https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/" rel="nofollow">https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/</a>) Once create ssh key using git bash and added to github. It works only for that particular git bash. If I close git bash and open again. Same ssh key wont work, need to create new. CAn anyone please tell me why is it happening? or what is missing?

Answer1:

You would need to auto add the ssh key to every session when you open Git Bash. For that, if you are on Windows, follow the below steps :

<ul><li>Go to the location of Git installation (usually at C:\Program Files\Git\etc\ssh)</li> <li>Edit the ssh_config file and add the line IdentityFile Drive:\path\to\key where Drive:\path\to\key should specify the local path to your key that you have generated earlier, and save the file after editing.</li> </ul>

Now every time you open Git Bash, the key would automatically be added to the ssh session and you will not need to add the ssh key everytime.

Recommend

  • jQuery and Uploadify session in the php file
  • How to add System.Windows dll to Visual Studio 2010 express?
  • Double dispatch in Java example
  • Hibernate to update table schema
  • Query to find the duplicates between the name and number in table
  • How can I extract results of aggregate queries in slick?
  • custom UITableViewCell with image for highlighting
  • Jackson Parser: ignore deserializing for type mismatch
  • How to define and use opencv mat of user type
  • Change multiple background-images with jQuery
  • Debugging ASP.NET on a built-in web server suddenly stops
  • Optimizing database types to compact database (SQLite)
  • Why HTML5 Canvas with a larger size stretch a drawn line?
  • How to recover from a Spring Social ExpiredAuthorizationException
  • TFS: Get latest causes slow project reloading
  • Controls, properties, events and timers running in design time
  • How to redirect a user to a different server and include HTTP basic authentication credentials?
  • ILMerge & Keep Assembly Name
  • Running a C# exe file
  • Cassandra Data Model
  • Can I make an Android app that runs a web view in Chrome 39?
  • Trying to switch camera back to front but getting exception
  • Large data - storage and query
  • WOWZA + RTMP + HTML5 Playback?
  • R: gsub and capture
  • jqPlot EnhancedLegendRenderer plugin does not toggle series for Pie charts
  • How do I rollback to a specific git commit
  • Comma separated Values
  • InvalidAuthenticityToken between subdomains when logging in with Rails app
  • Angular 2 constructor injection vs direct access
  • Getting Messege Twice Using IMvxMessenger
  • Java static initializers and reflection
  • Android Google Maps API OnLocationChanged only called once
  • LevelDB C iterator
  • Linking SubReports Without LinkChild/LinkMaster
  • How to get NHibernate ISession to cache entity not retrieved by primary key
  • Reading document lines to the user (python)
  • UserPrincipal.Current returns apppool on IIS
  • Python/Django TangoWithDjango Models and Databases
  • How to load view controller without button in storyboard?