SSH Key Authentication: Difference between revisions

From Cheaha
Jump to navigation Jump to search
Line 54: Line 54:
* Now open application '''Putty'''.
* Now open application '''Putty'''.


* Set up your session for '''Cheaha''' in PuTTy. (If you don't know how, follow these [https://docs.uabgrid.uab.edu/wiki/Cheaha_GettingStarted#PuTTY instructions]).
* Set up your session for '''cheaha.rc.uab.edu''' in PuTTy. (If you don't know how, follow these [https://docs.uabgrid.uab.edu/wiki/Cheaha_GettingStarted#PuTTY instructions]).


* Login to your Cheaha account.
* Login to your Cheaha account.


* Paste the content of the '''Public key''' that you generated using '''Puttygen''' in '''~/.ssh/authorized_keys''' using your favorite editor.
* Paste the content of the '''Public key''' that you generated using '''Puttygen''' in '''~/.ssh/authorized_keys''' using your favorite editor.
* Now '''exit/logout''' out of your account on '''cheaha.uabgrid.uab.edu'''.
* Use these settings to configure a session for new Cheaha:
{| border="1" cellpadding="5"
!Field
!Cheaha Settings
|-
|'''Host Name (or IP address)'''
|cheaha.rc.uab.edu
|-
|'''Port'''
|22
|-
|'''Protocol'''
|SSH
|-
|'''Saved Sessions'''
|cheaha.rc.uab.edu
|-
|}
* Click '''Save''' to save the configuration.


* Now select your saved session for '''cheaha.rc.uab.edu'''.
* Now select your saved session for '''cheaha.rc.uab.edu'''.
Line 95: Line 73:


'''Note:''' You need to perform these steps just for the first time access, you should be able to directly run your '''cheaha.rc.uab.edu''' profile from next time.
'''Note:''' You need to perform these steps just for the first time access, you should be able to directly run your '''cheaha.rc.uab.edu''' profile from next time.


====SSH Secure Shell Client====
====SSH Secure Shell Client====

Revision as of 16:12, 17 October 2016

These instructions assist existing users of Cheaha in getting access to new Cheaha.


Mac OS X

  • On your Mac open Terminal application.
  • Run the following command on your terminal:
ssh-keygen -t rsa
  • You can put a passphrase for your SSH key ( Not mandatory but highly recommended)
  • A id_rsa.pub file would have been created.
  • Open the file by running less .ssh/id_rsa.pub and copy the content.
  • Press q to exit out of the file.
  • Now SSH to your cheaha.rc.uab.edu account , and paste the content in ~/.ssh/authorized_keys using your favorite editor.
  • Now log out from cheaha.rc.uab.edu and login again. You shouldn't see a prompt for password and be directly logged in.

Note: You need to perform these steps just for the first time access, you should be able to directly run ssh blazerid@cheaha.rc.uab.edu from next time.

Linux

  • On your linux machine open Terminal application.
  • Run the following command on your terminal:
ssh-keygen -t rsa
  • You can put a passphrase for your SSH key ( Not mandatory but highly recommended)
  • A id_rsa.pub file would have been created.
  • Open the file by running less .ssh/id_rsa.pub and copy the content.
  • Press q to exit out of the file.
  • Now SSH to your cheaha.rc.uab.edu account , and paste the content in ~/.ssh/authorized_keys using your favorite editor.
  • Now log out from cheaha.rc.uab.edu and login again. You shouldn't see a prompt for password and be directly logged in.

Note: You need to perform these steps just for the first time access, you should be able to directly run ssh blazerid@cheaha.rc.uab.edu from next time.

Windows

Putty

You would require a tool called puttygen, to generate SSH keys for the pairing purpose. You can downlaod it here. Once you have downloaded and installed putty and puttygen, follow these instructions:

  • Launch PuTTY Key Generator.
  • Launch the program, click the Generate button. The program generates the keys for you.
  • Enter a unique key passphrase in the Key passphrase and Confirm passphrase fields.
  • Save the public and private keys by clicking the Save public key and Save private key buttons.
  • Enter a unique key passphrase in the Key passphrase and Confirm passphrase fields. You will be prompted for that passphrase whenever you log in to a server with this key. (Not Mandatory, but highly recommended)
  • Copy the content from the public file that you just generated.
  • Now open application Putty.
  • Set up your session for cheaha.rc.uab.edu in PuTTy. (If you don't know how, follow these instructions).
  • Login to your Cheaha account.
  • Paste the content of the Public key that you generated using Puttygen in ~/.ssh/authorized_keys using your favorite editor.
  • Now select your saved session for cheaha.rc.uab.edu.
  • Click Connection > SSH > Auth in the left-hand navigation pane and configure the private key to use by clicking Browse under Private key file for authentication.
  • Navigate to the location where you saved your private key earlier, select the file, and click Open.
  • The private key path is now displayed in the Private key file for authentication field.
  • Click Session in the left-hand navigation pane and click Save in the Load, save or delete a stored session section.
  • Click Open to begin your session with the server.

Note: You need to perform these steps just for the first time access, you should be able to directly run your cheaha.rc.uab.edu profile from next time.

SSH Secure Shell Client

  • In SSH Secure Shell, from the Edit menu, select Settings...
  • In the window that opens, select Global Settings, then User Authentication, and then Keys.
  • Under "Key pair management", click Generate New.... In the window that appears, click Next.
  • In the Key Generation window that appears:
    • From the drop-down list next to Key Type:, select from the following:
      • If you want to take less time to initially generate the key, select DSA.
      • If you want to take less time during each connection for the server to verify your key, select RSA.
    • From the the drop-down list next to Key Length:, select at least 1024. You may choose a greater key length, but the time it takes to generate the key, as well as the time it takes to authenticate using it, will go up.
  • Click Next. The key generation process will start. When it's complete, click Next again.
  • In the File Name: field, enter a name for the file where SSH Secure Shell will store your private key. Your public key will be stored in a file with the same name, plus a .pub extension.
    • Important: You can put a passphrase for your SSH key ( Not mandatory but highly recommended)
  • To complete the key generation process, click Next, and then Finish.
  • At the Settings screen, click OK.
  • Copy the content of .pub file generated.
  • Now SSH to your cheaha.uabgrid.uab.edu account, following the instructions here , and paste the content in ~/.ssh/authorized_keys using your favorite editor.
  • Now exit/logout from your account on cheaha.uabgrid.uab.edu
  • Now ssh into blazerid@cheaha.rc.uab.edu , following the instructions here. Remember to change Host Name to cheaha.rc.uab.edu
  • You should have been able to login to new Cheaha.

Note: You need to perform these steps just for the first time access, you should be able to directly run your cheaha.rc.uab.edu profile from next time.