SSH connection settings
Secure Shell (SSH) provides a secure and efficient way to establish a connection between your local machine and remote Git repositories. By leveraging SSH connection settings, you can enhance the security of your Git workflow and streamline your collaboration efforts.
In this section, we will explore the process of setting up and configuring SSH connections for Git. We will guide you through generating SSH keys and configuring your local Git client to use SSH for remote operations.
By understanding and implementing SSH connection settings, you will strengthen your authentication mechanisms, eliminate the need for repetitive password prompts, and enable efficient collaboration with your team members. Moreover, using SSH ensures that your Git commands and data remain secure during transfers, providing peace of mind for your development projects.
Explore SSH connection settings and unlock the power of secure and efficient Git collaboration.
Set up SSH connection (Windows)
Go to Start menu > All Programs > Open TortoiseGit and start Putty Key Generator.
Click on “Generate” and move the mouse cursor within the red frame until the progress bar completes. This will randomly generate a key.
When the key generation is complete, you will see the following display. Click “Save private key” and save the “.ppk” file.
You can view the public key again in the future by loading the “.ppk” file into Putty Key Generator.
In order to configure SSH connection when we push with TortoiseGit, right-click on TortoiseGit, then choose “Manage.”
With “origin” selected in the remote column, add the SSH path to the URL field, and add the “.ppk” file path that we have just saved to the Putty Key field. Click “Add New/Save.” Now, the origin remote that is associated with the SSH URL path will be added to the list of remote in this repository. Click “OK” to complete.
Set up SSH connection (Mac)
Open terminal under application/utility and execute the following command.
$ ssh-keygen
You will see the following output. You may optionally enter the passphrase for this generated RSA key pair.
Continue by hitting enter if you do not wish to set a passphrase.
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/username/.ssh/id_rsa): <Press Enter key>
Created directory '/Users/username/.ssh'.
Enter passphrase (empty for no passphrase): <Input passphrase>
Enter same passphrase again: <Please enter the same passphrase again>
Your identification has been saved in /Users/username/.ssh/id_rsa.
Your public key has been saved in /Users/username/.ssh/id_rsa.pub.
The key fingerprint is:
57:15:3c:ca:f2:dc:27:6d:c2:9a:88:d0:70:cf:8d:31 username@username-example-device
The key's randomart image is:
+--[ RSA 2048]----+
| .o. |
| .o |
| ... . |
| . . E.o |
| +So.O o . |
| . ..+ + = +|
| . . . o = |
| . . o |
| |
+-----------------+
You can view the public SSH key with the following command.
$ cat ~/.ssh/id_rsa.pub
Output example
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDkkJvxyDVh9a+zH1f7ZQq/JEI79dVjDSG
4RzttQwfK+sgWEr0aAgfnxdxQeDKxIxqI1SwyTY8oCcWzvpORuPqwbc7UWWPcCvbQ3jlEdN
5jvwKM82hincEWwI3wzcnVg2Mn8dH86b5m6REDzwRgozQ3lqrgwGVlTvkHDFs6H0b/1PSrM
XGppOP/QXGEVhZ6Hy4m3b1wMjjrbYwmWIeYklgoGHyrldhAaDYc33y7aUcRyFyq5DubtsLn
2oj4K+1q36iviCHxCOri0FDmn2dzylRCI4S+A2/P7Y7rVfdT+8OWYKCBUs8lfjujghEtejq
Qmj9ikyGTEAW1zQCN7hVwYdjL hoge@hoge.local
Copy and paste this key into the remote repository settings.
Set up SSH connection (Console)
Execute the following command.
$ ssh-keygen
You will see the following output. You may optionally enter the passphrase for this generated RSA key pair. Hit enter if you do not wish to set a passphrase.
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/username/.ssh/id_rsa): <Press Enter key>
Created directory '/Users/username/.ssh'.
Enter passphrase (empty for no passphrase): <Input passphrase>
Enter same passphrase again: <Please enter the same passphrase again>
Your identification has been saved in /Users/username/.ssh/id_rsa.
Your public key has been saved in /Users/username/.ssh/id_rsa.pub.
The key fingerprint is:
57:15:3c:ca:f2:dc:27:6d:c2:9a:88:d0:70:cf:8d:31 username@username-example-device
The key's randomart image is:
+--[ RSA 2048]----+
| .o. |
| .o |
| ... . |
| . . E.o |
| +So.O o . |
| . ..+ + = +|
| . . . o = |
| . . o |
| |
+-----------------+
You can view the public SSH key with the following command.
$ cat ~/.ssh/id_rsa.pub
Output example
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDkkJvxyDVh9a+zH1f7ZQq/JEI79dVjDSG
4RzttQwfK+sgWEr0aAgfnxdxQeDKxIxqI1SwyTY8oCcWzvpORuPqwbc7UWWPcCvbQ3jlEdN
5jvwKM82hincEWwI3wzcnVg2Mn8dH86b5m6REDzwRgozQ3lqrgwGVlTvkHDFs6H0b/1PSrM
XGppOP/QXGEVhZ6Hy4m3b1wMjjrbYwmWIeYklgoGHyrldhAaDYc33y7aUcRyFyq5DubtsLn
2oj4K+1q36iviCHxCOri0FDmn2dzylRCI4S+A2/P7Y7rVfdT+8OWYKCBUs8lfjujghEtejq
Qmj9ikyGTEAW1zQCN7hVwYdjL hoge@hoge.local
Copy and paste this key in the remote repository setting.
Register SSH public key to Backlog
Login to Backlog with your account username that has access to the Git repository. Once logged in, click on “Personal Settings.”
Click “Register SSH public key.”
Paste the SSH public key into the text area and click “Submit.”