Cloud:Storage:CreateS3Credentials: Difference between revisions

From ZeroOne Tech Public Wiki
m (Thefathacker moved page Cloud:Storage:CreateCredentials to Cloud:Storage:CreateS3Credentials without leaving a redirect: Misspelled title)
(Updated Setup Guide)
Line 1: Line 1:
=== Linux ===
= OpenStack S3 - Generate S3 Credentials =
This guide is to provide instructions to allow you to generate S3 Credentials for Later use


# Ubuntu 24.04
Requirements:
* Python3
* Python3-pip or apt with python package Management
* Python3 Openstack Client
* bash (Windows Users: Git Bash)


<pre>
== Environment Preparation ==
apt install python3-openstackclient
To prepare your environment you will need to setup the required software packages for your given operating system
</pre>
 
=== Install Required Packages ===
==== Linux ====
===== Ubuntu/Debian (and forks) =====
<code>apt install python3 python3-openstackclient</code>
 
Alternatively if you are using pip for python package management
<code>
apt install python3 python3-pip
pip install python-openstackclient
</code>
===== Fedora (or EL Based Distributions) =====
for dnf users:
<code>dnf install python3 python3-pip</code>
 
for yum users:
<code>yum install python3 python3-pip</code>
 
<code>pip install python-openstackclient</code>
 
==== MacOS ====
TODO CONFIRM HOW TO SETUP Python on Windows
 
==== Windows ====
Install Required Packages
* [https://git-scm.com/downloads/win Git Bash from git for Windows]
* [https://www.python.org/downloads/ Python3 for Windows with Python pip]
 
If you use [https://chocolatey.org/ Chocolatey]: <code>choco install python3 git.install</code>


// ADD SCREENSHOT HERE FOR RC FILE
With python & python-pip installed, in a new PowerShell or CMD Terminal <code>pip install python-openstackclient</code>
https://cloud.zeroone.tech/project/api_access/openrc/


<pre>
=== Importing Openstack Environmental Varibles ===
source default-openrc.sh  
# [[File:Openstack RC Download.png|right]] Download your OpenStack Environmental Variables file (OpenStack RC File), do this by logging into your Openstack Dashboard, navigating to the top right corner user icon/label and download your OpenStack RC File <div style="clear: both"></div>
Please enter your OpenStack Password for project docs as user [Openstack User]:
# [[File:OpenStack Cli Setup.png|right]] Open your preferred bash shell (or Git Bash on Windows) and nativate to where ever the download OpenStack RC File. Example: <pre>cd ~/Downloads</pre> to navigate to your Downloads File
</pre>
# Use the downloaded Openstack RC file for Source Data by using the source command, example: <pre>source 3a5c8-default-openrc.sh</pre> you will then be asked for your openstack password
# Test your credentials now work run <pre>openstack image list</pre> which will query the available server images in ZWS <div style="clear: both"></div>


You can now use the following command
== Credential Management ==
=== Generate New Credential ===
Use the following command to generate a new credential
<pre>
<pre>
openstack ec2 credentials create
openstack ec2 credentials create
Line 35: Line 70:


The important value which will be unrecoverable after this point will be the secret. Also take note of the access as this will also be required for provisioning services with the S3 compatible API.
The important value which will be unrecoverable after this point will be the secret. Also take note of the access as this will also be required for provisioning services with the S3 compatible API.
=== Get Existing Credentials ===
Use the following command to get your existing Credentails
<pre>
openstack ec2 credentials list
</pre>


<strong>IMPORTANT NOTE:</strong> Please note there is only one EC2 credential per user tenant, <strong>re-creating this credential will replace the credential and any services using this credential being lost.</strong>
<strong>IMPORTANT NOTE:</strong> Please note there is only one EC2 credential per user tenant, <strong>re-creating this credential will replace the credential and any services using this credential being lost.</strong>

Revision as of 02:02, 9 April 2025

OpenStack S3 - Generate S3 Credentials

This guide is to provide instructions to allow you to generate S3 Credentials for Later use

Requirements:

  • Python3
  • Python3-pip or apt with python package Management
  • Python3 Openstack Client
  • bash (Windows Users: Git Bash)

Environment Preparation

To prepare your environment you will need to setup the required software packages for your given operating system

Install Required Packages

Linux

Ubuntu/Debian (and forks)

apt install python3 python3-openstackclient

Alternatively if you are using pip for python package management apt install python3 python3-pip pip install python-openstackclient

Fedora (or EL Based Distributions)

for dnf users: dnf install python3 python3-pip

for yum users: yum install python3 python3-pip

pip install python-openstackclient

MacOS

TODO CONFIRM HOW TO SETUP Python on Windows

Windows

Install Required Packages

If you use Chocolatey: choco install python3 git.install

With python & python-pip installed, in a new PowerShell or CMD Terminal pip install python-openstackclient

Importing Openstack Environmental Varibles

  1. Download your OpenStack Environmental Variables file (OpenStack RC File), do this by logging into your Openstack Dashboard, navigating to the top right corner user icon/label and download your OpenStack RC File
  2. Open your preferred bash shell (or Git Bash on Windows) and nativate to where ever the download OpenStack RC File. Example:
    cd ~/Downloads
    to navigate to your Downloads File
  3. Use the downloaded Openstack RC file for Source Data by using the source command, example:
    source 3a5c8-default-openrc.sh
    you will then be asked for your openstack password
  4. Test your credentials now work run
    openstack image list
    which will query the available server images in ZWS

Credential Management

Generate New Credential

Use the following command to generate a new credential

openstack ec2 credentials create

Which will give you output similar too:

+------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| Field      | Value                                                                                                                                     |
+------------+-------------------------------------------------------------------------------------------------------------------------------------------+
| access     | abababababababababababababababab                                                                                                          |
| links      | {'self': 'https://cloud.zeroone.tech:5000/v3/users/dededededededededededededededede/credentials/OS-EC2/abababababababababababababababab'} |
| project_id | bcbcbcbcbcbcbcbcbcbcbcbcbcbcbcbc                                                                                                          |
| secret     | cdcdcdcdcdcdcdcdcdcdcdcdcdcdcdcd                                                                                                          |
| trust_id   | None                                                                                                                                      |
| user_id    | dededededededededededededededede                                                                                                          |
+------------+-------------------------------------------------------------------------------------------------------------------------------------------+

The important value which will be unrecoverable after this point will be the secret. Also take note of the access as this will also be required for provisioning services with the S3 compatible API.

Get Existing Credentials

Use the following command to get your existing Credentails

openstack ec2 credentials list

IMPORTANT NOTE: Please note there is only one EC2 credential per user tenant, re-creating this credential will replace the credential and any services using this credential being lost.