15
[email protected] 1 Generate SSH Keys [Edition 03] [Last Update 201207] Atul Kumar Oracle ACE & Cloud Expert

Generate SSH Keys

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

[email protected] 1

Generate SSH Keys

[Edition 03]

[Last Update 201207]

Atul Kumar

Oracle ACE & Cloud Expert

[email protected] 2

1 Introduction .........................................................................................................................................................3

2 Documentation Links ........................................................................................................................................4

3 Generate SSH Keys (Public & Private) .........................................................................................................5 3.1 Generate SSH Private & Public Keys using PuttyGEN..................................................................................... 6 3.2 Download PuttyGen Software ................................................................................................................................ 6 3.3 Generate Keys on Windows Laptop/Desktop ................................................................................................... 7 3.4 Generate SSH Keys on MAC .................................................................................................................................... 13

4 SUMMARY ........................................................................................................................................................... 15

[email protected] 3

1 INTRODUCTION

This activity guide cover steps to

• Generate SSH Keys

• Connect to Unix Server on Cloud using Putty/Terminal We also use this as first guide in our following Cloud Trainings (this is just first guide and in these trainings) a) [1Z0-1072] Oracle Cloud Architect Certification: OCI Concepts I IAM | Compute |

Storage | Network (VCN, DNS, LBR) | Database (User Managed & Autonomous) | Advanced IAM & Networking | HA & DR including Certification Exam Q/A (Dumps)

• For Step by Step Activity Guide in this Course check http://k21academy.com/oci05

b) Oracle DBA to Cloud DBA Certification: Database Cloud Service Certification

• For Step By Step Hands-On Guides in this Course visit http://k21academy.com/1z016005

c) Oracle EBS R12 on Cloud for Apps DBA’s:Create, Manage & Migrate (Lift &

Shift)EBS R12 in Cloud http://k21academy.com/ebscloud03 for Step by Step Activity Guide in this Course check http://k21academy.com/ebscloud05

d) Cloud Security using Oracle Identity Cloud Service (IDCS): For course topics visit

http://k21academy.com/idcs03 for Step by Step Activity Guide in this Course check http://k21academy.com/idcs05

e) Oracle Integration Cloud Services: For course topics visit

http://k21academy.com/oic03 for Step by Step Activity Guide in this Course check http://k21academy.com/oic05

[email protected] 4

2 DOCUMENTATION LINKS

1. Subscribe to Oracle Cloud Service Account https://docs.oracle.com/en/cloud/get-started/subscriptions-cloud/get-a-trial-or-subscription.html

2. Terminating Oracle Cloud Subscription https://docs.oracle.com/en/cloud/get-started/subscriptions-cloud/mmocs/terminating-your-paid-subscription-my-services.html

3. Generate SSH Keys for Linux, Mac or Windows https://docs.oracle.com/en/cloud/paas/database-dbaas-cloud/csdbi/generate-ssh-key-pair.html#GUID-4285B8CF-A228-4B89-9552-FE6446B5A673

4. Download Putty http://www.putty.org

5. Download PuttyGenhttp://puttygen.software.informer.com/download/

6. FREE Cloud Credit FAQ https://shop.oracle.com/apex/f?p=CLOUD:23:14585164885640:::23:

7. Administering Oracle Database Cloud Service: Create a Customized Database Deploymenthttps://docs.oracle.com/en/cloud/paas/database-dbaas-cloud/csdbi/create-db-deployment.html

8. To get to know about more on basic terminologies used in this document, refer the following link :http://docs.oracle.com/en/cloud/get-started/subscriptions-cloud/csgsg/oracle-cloud-terminology.html#CSGSG116

9. Oracle Cloud Infrastructure ( Using Console) https://docs.us-phoenix-1.oraclecloud.com/Content/GSG/Concepts/console.htm?#Understa

10. Troubleshooting: Connect to Oracle Cloud using Putty: No supported Authentication Methods Available

https://k21academy.com/oracle-cloud/oracle-cloud-troubleshooting-no-supported-authentication-methods-available/#

11. Request and Manage Free Oracle Cloud Promotions

https://docs.oracle.com/en/cloud/get-started/subscriptions-cloud/csgsg/request-and-manage-free-oracle-cloud-promotions.html

12. How To Request an OCI Limit Increase (Doc ID 2434814.1)

13. OCI: Viewing and Understanding Service Limits (Doc ID 2432488.1)

[email protected] 5

3 GENERATE SSH KEYS (PUBLIC & PRIVATE)

Note: Steps in this section are applicable only for cloud services for which you need to connect to Linux Machine on Cloud using SSH (like Database, Architect Certification 1Z0-1072 or EBS on OCI) You can skip this section of Identity Cloud Service (IDCS) as all steps are done using Console. For EBS on OCI, Cloud OCI Architect Certification 1Z0-1072, we will suggest to Generate SSH Keys, so that it will used when you go to the next Module Activity Guide where you will create a Compute or Database Instance based on which course you are

Before you can create Database or EBS (R12) instance on Cloud, You must generate SSH Key Pair (Private & Public Keys) so that you can connect to Linux Machine on which Database or EBS R12 is installed .

Public Key will be uploaded on Oracle Cloud Server while private key must be kept safe with you

[email protected] 6

3.1 Generate SSH Private &

Public Keys using PuttyGEN

In this section we download WinSCP installer with puttygen (Utility to connect to Unix server) from and

a) Generate Private & Public Key on local Laptop or PC using puttygenkeygen tool from putty that we created in previous section (make a note of location of private & public Key).

b) When we create Database as a Service Instnce, you provide public key that gets stored on Oracle Dabase Cloud Service Server (It is OK to share Public Key but never share Private Key)

c) Future connection from local Laptop/PC is securily done over SSH and is Authenticated using Private/Public Key pair.

Depending on operating system of your laptop or desktop (Windows or Mac) refereresepective section to generate SSH Private and Public Keys.

3.2 Download PuttyGen Software

Download Puttygen Software from any one of the following locations

1) https://k21academy.com/puttygen

Install PuttyGen Click “Run PuttyGen.

[email protected] 7

3.3 Generate Keys on Windows

Laptop/Desktop

1. Open Putty Gen folder on your computer.

[email protected] 8

2. Double click on the Putty Gen folder to open it.

3. To generate the keys, Click on Generate and hover your mouse around the blank area (in the No Key area). The key will be generated in the format shown below.

[email protected] 10

4. Add the key passphrase (Password) and re-enter it again to confirm passphrase. Click on Save private key button to save the private key in your system.

Note:We can also save private key without passphrase but for security reasons you can enter passphrase. (In production you must use passphrase to protect your private key).

[email protected] 11

5. For public key, first copy and paste the Key content in some other file (like notepad) from the shown window as sometimes it shows issue while accepting public key file. In that case we can use the copied key content. After that click on Save Public Key to save the file and save at the same location where you have saved private key in your system.

Note: Public key format start with ssh-rsa & end with rsa-key-20190314

After generating and saving both the keys, you can go back to the Cloud Portal.

[email protected] 12

6. This will generate Private & Public Key, Save them to your Laptop/Desktop.

[email protected] 13

3.4 Generate SSH Keys on MAC

If you are on Mac and using Terminal (and not Putty) then follow https://www.siteground.com/kb/how_to_generate_an_ssh_key_pair_in_mac_os/

[email protected] 14

Note: Make a note of these two keys as you will need public key in next Activity Guide.

This is how the Private key will look like in MAC:

cat id_rsa

-----BEGIN OPENSSH PRIVATE KEY-----

b3BlbnNza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BAUGBw==

-----END OPENSSH PRIVATE KEY-----

This is how Public Key will look like in MAC

catid_rsa.pubssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDPAdtwkpbpiBFZwgovfnWrFZEUseO8X36gXLD2tHDji/3uDi+s7hvfXzwDuZPT3S/KG34SGQfm3mNIGuFzSjEO3adI0bImaJjbyfB1QDE1B/s9IorMiyI03FAgJZ9gURlWmg+PCQzzXEragBK1w0W/s+A8eCRWgfvv5x4HOn2ColF8Y7FsDct3aCpHoi99aQUiQMNu5tRPabWBFbpjqqzGBGfv8OBbJJshg6f4wnkmpZPMWzDIqmuhQrzajKQBSmPAV14IQcqmyfxpibbYvIhDSccxkJwOmsqt7ACu4tvh6tcq0gjr4FJgiBLdbjOdErs6pgUMEXdnDxKOqEv9vvJR [email protected]

Note :Download Next Acitivity Guide from Membership Portal http://k21academy.com/my-courses and depending on which training you are part of

[email protected] 15

4 SUMMARY

This completes step by step guide covering:

• Generated SSH Keys