Generate SSH Keys¶
- Generate SSH Keys
SSH Pair Key¶
- A private-public key pair is generated at a user's local workstation for a secure remote communication to a server.
- The private key is an encrypted identity of the user.
- The public key is also encrypted but is sent and registered to a server.
- When the user accesses the server remotely, he is recognized and allowed access by the registered public key because it can identify its unique pairing with the private key. This remote and encrypted accessing of a server process is what we call the SSH or Secure Shell protocol. The SSH public key is enrolled in the ASTI facility for a user's secure password-less remote access.
Why Use SSH Keys?¶
1. More secure connection¶
- SSH pair keys (public and private) are the only means to identify yourself to an SSH server (CoARE facility)
- You can access the CoARE facility without sending any password over the network. Thus, there is no password that can be intercepted and cracked by someone who is eavesdropping your connection
- The public key you submitted are registered to your account while the private key you generated is what you will use to access the facility. The SSH server will determine if the public registered in your account matches the private key you used to access the facility. You will be allowed to access the facility if the two keys match.
- Using SSH keys for authentication reduces risk of brute-force attack because it is harder for the attacker to guess a user's SSH keys than passwords
2. Easier login¶
- Logging in via SSH is fairly convenient for users since it does not require any password. You don't have to enter your long and complicated passwords every time you want to login. You only have to load your private key and enter your username and the IP address we provided to you.
- Your remote server is running on a Linux-based Operating System
- You are using either a Linux-based OS or Windows OS
- You have sudo privileges in your system
A. For Linux OS¶
- Launch your terminal application
- Issue these commands:
$ $ ssh-keygen $ cd ~/.ssh $ cat id_rsa.pub
- Save both your private and public key.
- Copy the produced public key to the online form.
B. FOR WINDOWS USERS¶
- Download PuTTYgen.
- You may download it from here: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
2. Run the application
Under the Parameters section, tick the SSH-2 RSA bullet and make sure that the key is set to 2048 bit for security purposes. Then click Generate.
Note: If SSH-2 RSA is not available, adjust the key parameter at the bottom of the Putty Key Generator to SSH-1(RSA)
3. Once finished, SAVE the public key and private key.
The generator will prompt you where to save your file. Save your file in a secure location.