Generating a CSR for Google Cloud Services

Generating a CSR for Google Cloud Services

Google Cloud Platform enables you to generate a CSR (Certificate Signing Request) using Google Cloud Shell, which is a built-in Command Line Console providing direct access to cloud resources from a web browser.

ជំហានទី 1: បង្កើតគម្រោង

To begin, log in to your Google account, navigate នៅ​ទីនេះ ហើយចុចលើ បង្កើតគម្រោង to activate the Cloud Shell. If a project already exists, you may use that instead of creating a new one.

Specify a human-readable name for your project. You can edit the project name at any time during or after project creation. Project names do not need to be unique.

Step 2: Activate the Cloud Shell session

បន្ទាប់ចុចលើប៊ូតុង បើកដំណើរការ Cloud Shell button at the top of the window:

A new Cloud Shell session will be opened at the bottom of the window. By default, it will open to the user Home directory/home/user:

Step 3: Generate a CSR code in Cloud Shell

Follow the below steps to generate your CSR:

  1. Run the following command to create Private key and Certificate Signing Request (CSR) files (server.key និង server.csr).

    គន្លឹះមានប្រយោជន៍: we recommend replacing ម៉ាស៊ីនបម្រើ in server.key and server.csr with the ឈ្មោះដែន name the certificate will be issued for. This will make it easier to find the files in the future.

    openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr
  2. Enter the following details using English alphanumeric symbols only:
    • ឈ្មោះ​ប្រទេស

      Use a two-letter code. You can check your country code នៅ​ទីនេះ.
    • ឈ្មោះរដ្ឋ ឬខេត្ត

      Use the full name of your state or province. If your country is not divided into states, the city can be mentioned.
    • ឈ្មោះតំបន់

      Add the full name of the city.
    • ឈ្មោះ​អង្គការ

      Mention the officially registered name of the company applying for a certificate (e.g., 1Byte, Inc.).

      ចំណាំ: សម្រាប់។ សុពលភាពដែន certificates, ‘NA‘ can be used as this field will not be listed in the certificate details.
    • Organizational Unit Name

      Specify the name of the division or department within the company indicated above. You can use ‘NA‘ here.
    • ឈ្មោះទូទៅ

      Indicate the exact domain or subdomain name you wish to secure (i.e. example.com or *.example.com សម្រាប់ វិញ្ញាបនបត្រជំនួស).
    • អាស័យ​ដ្ឋាន​អ៊ី​ម៉េ​ល

      Enter the email you want the issued certificate to be sent to. It is possible to change this during activation.
    • Challenge password and Optional company name

      Leave these fields empty. For this, simply press បញ្ចូល.
  1. Once all the requested information is provided, you will have two files generated in the current directory: *.csr and *.key .
  2. To open the file with the CSR code, enter the following command:
    cat server.csr
    ដែលជាកន្លែងដែល server.csr នេះគឺជា exact name of your .csr file.
    The CSR file (*.csr) contains the code that should be used for SSL activation in your 1Byte account. Make sure to copy with the header and footer which are: “—–BEGIN CERTIFICATE REQUEST—- and “—–END CERTIFICATE REQUEST—-”

Feel free to verify the generated CSR code using the ឧបករណ៍.

To open the file with the Private key, enter the following command:

cat server.key

ដែលជាកន្លែងដែល server.key នេះគឺជា exact name of your .key file.

គន្លឹះមានប្រយោជន៍: The Private key code is essential for certificate installation, which is performed after the certificate is activated and issued. It is crucial to remember the file name and location of your Private key so you can find it easily. The file content is a block of code that starts with “—–BEGIN PRIVATE KEY—–” and ends with “—–END PRIVATE KEY—–“.

To find the Private key, the following command can be used:

sudo find / -type f -iname ‘server.key’

ដែលជាកន្លែងដែល server.key នេះគឺជា exact name of the key file. ‘*.គន្លឹះ‘ can be used if the name of the file is forgotten. In that case, the output of the command will show the paths to all the .key files on the server.

ធ្វើឱ្យប្រាកដ ធ្វើឱ្យសកម្ម the certificate using the recently created CSR code. You then must ធ្វើ​ឱ្យ​មាន​សុពលភាព វានិង ដំឡើង it on your site to work properly.