12/2/2023 0 Comments Github sourcetree ssh key![]() ![]() Generate your SSH keysĪt the command line, type ssh-keygen -f (defaults to RSA encryption, and refers to the file name - make this describe your account to you can recognise it). This presumes that you're using Windows with SourceTree as your Git client, and are also happy using OpenSSH rather than Putty. Step by Stepīelow is a more compact step-by-step set of instructions on how to set this up. Whilst I'm sure it's possible to get it working using Putty Pageant with a bit more digging - switching to OpenSSH and using the config file was the solution that worked for me, and I'm most happy with. Add SSH Key menu item - everything then worked perfectly. After switching over to OpenSSH in the SourceTree configuration, then adding the keys via the SourceTree Tools. I quite like the idea of using the config file to set up aliases, as it feels very explicit - so I tried using OpenSSH instead of Putty. There is a direct equivalent in PuTTY, but it involves setting up 'Saved Sessions' in the PuTTY GUI instead - you use the session name as an alias effectively and provide the host name, key to use and other details in the GUI. That config file won't be picked up by PuTTY. Still not working quite correctly though! What I didn't realise was that Putty doesn't use the config file (well at least not according to Steve from Atlassian on this thread). I instead use the alias from the config file: :myUserName/myRepoName.git So instead of: :myUserName/myRepoName.git Then I just needed to alter the Git repo's remote URL to use this alias. So one of my accounts worked, but the others didn't.Īfter a bit of reading on the internet, I was reminding about the ~\.ssh\config file, so then attempted to set up aliases: Host The problem I found when doing this was that it would always use just the first key. You can right-click and add/view your keys that you've generated with the Putty Key Generator tool. This is a little program that sits in your system tray to manage your SSH keys. SourceTree by default uses Putty's Pageant to manage the keys. After playing around a bit, I got it working, so thought I'd write it down for future use and hopefully to help others at the same time. This was very simple to set up for a single account, but it didn't work as smoothly for multiple accounts using different keys. I didn't have the same trouble if I had one using SSH, and the other using HTTPS.Įither way, I'd rather use SSH for authentication across all my accounts. I suspect the re-prompting for password is related to having multiple Bitbucket accounts, and it was getting confused and trying to authenticate against the wrong one. I use a couple of different Bitbucket accounts, and in the past have mostly just used HTTPS to connect, but did find that I was getting prompted for credentials more often than I would like - even after telling SourceTree (my GUI of choice) to save those credentials. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |