Skip to content

Commit 3cc23a9

Browse files
authored
Merge pull request #134 from oracle-devrel/lvb-textual-improvements
Documentation and textual improvements.
2 parents bafee36 + dcb9f97 commit 3cc23a9

File tree

3 files changed

+109
-138
lines changed

3 files changed

+109
-138
lines changed
Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Bastion Session Script
2-
2+
33
This shell script can be used to easily connect to the OCI Bastion service based on temporary SSH keys. Authorization is granted based on OCI CLI authentication and OCI Permissions. For OCI CLI authentication both the use of exchanged API keys and session security tokens is supported. This script works also directly on OCI Cloud Shell, however only for Managed SSH Sessions since port forwarding is not supported on OCI Cloud Shell.
4-
4+
55
## When to use this asset?
6-
6+
77
Use this shell script if you want to make use of OCI Bastions in a simple and secure way.
8-
8+
99
## How to use this asset?
10-
10+
1111
**Usage: ./bastion-session.sh COMMAND [ARGS]...**
1212

1313
Example:
@@ -19,42 +19,43 @@ Example:
1919

2020
**Commands:**
2121

22-
ssh : The session type "ssh" for Managed SSH session.
23-
24-
pf : The session type "pf" for Port Forwarding session.
22+
| Command | Description |
23+
|-----|-----------------------------|
24+
| ssh | The session type "ssh" for Managed SSH session.|
25+
| pf | The session type "pf" for Port Forwarding session.|
2526

2627
**Arguments:**
2728

28-
| short | long | description |
29-
|----|-----------------------------|---|
30-
| -b | --bastion TEXT | The Name of the Bastion to be used. [-b or -c is required]|
31-
| -c | --bastion-ocid TEXT | The OCID of the Bastion to be used. [-b or -c is required]|
32-
| -i | --instance TEXT | The name of the target instance to be used.|
33-
| -j | --instance-ocid TEXT | The OCID of the target instance to be used.|
34-
| -u | --username TEXT | The target resource username to be used. [default: opc]|
35-
| -p | --profile TEXT | The oci profile in the config file to load. [default: DEFAULT]|
36-
| -s | --session TEXT | The Bastion session name. [default: Bastion-Session]|
37-
| -t | --ttl INTEGER | The Bastion session time-to-live in seconds, minimum 1800, maximum 10800. [default: 10800]|
38-
| -d | --destination-ip IP | The destination IP Address to be used for Bastion session. [default: the first private ip address of instance]|
39-
| -e | --destination-port INTEGER | The destination port to be used for Port Forwarding session. [default: 22]|
40-
| -l | --local-port INTEGER | The local port to be used for Port Forwarding session. [defaults to same value as destination port]|
41-
| -a | --key-alg TEXT | The algorithm for the SSH key (ssh-keygen) to be used. [default: rsa]|
42-
| -k | --key-size INTEGER | The key size for the SSH key (ssh-keygen) to be used. [default: 4096]|
43-
| -pr| --private-key TEXT | The private key file to be used when not generating a temporary key pair. [by default not used]|
44-
| -pu| --public-key TEXT | The public key file to be used when not generating a temporary key pair. [by default not used]|
45-
| -v | --verbose | Show verbose output for troubleshooting.|
29+
| Arguments | Description |
30+
|---------------------------------|---|
31+
| -b, --bastion TEXT | (Required) The Name of the Bastion to be used. [-b or -c is required]|
32+
| -c, --bastion-ocid TEXT | (Required) The OCID of the Bastion to be used. [-b or -c is required]|
33+
| -i, --instance TEXT | The name of the target instance to be used.|
34+
| -j, --instance-ocid TEXT | The OCID of the target instance to be used.|
35+
| -u, --username TEXT | The target resource username to be used. [default: opc]|
36+
| -p, --profile TEXT | The OCI profile in the config file to load. [default: DEFAULT]|
37+
| -s, --session TEXT | The Bastion session name. [default: Bastion-Session]|
38+
| -t, --ttl INTEGER | The Bastion session time-to-live in seconds, minimum 1800, maximum 10800. [default: 10800]|
39+
| -d, --destination-ip IP | The destination IP Address to be used for Bastion session. [default: the first private ip address of instance]|
40+
| -e, --destination-port INTEGER | The destination port to be used for Port Forwarding session. [default: 22]|
41+
| -l, --local-port INTEGER | The local port to be used for Port Forwarding session. [defaults to same value as destination port]|
42+
| -a, --key-alg TEXT | The algorithm for the SSH key (ssh-keygen) to be used. [default: rsa]|
43+
| -k, --key-size INTEGER | The key size for the SSH key (ssh-keygen) to be used. [default: 4096]|
44+
| -pr, --private-key TEXT | The private key file to be used when not generating a temporary key pair. [by default not used]|
45+
| -pu, --public-key TEXT | The public key file to be used when not generating a temporary key pair. [by default not used]|
46+
| -v, --verbose | Show verbose output for troubleshooting.|
4647

4748
Prerequisites:
4849

49-
- The OCI Command Line Interface (CLI) must be installed and configured.
50-
(See also [https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm])
50+
- The OCI CLI must be installed and configured.
51+
(See also [https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm](https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm))
5152
- The jq commandline JSON processer must be installed.
52-
(See also [https://stedolan.github.io/jq])
53-
54-
# License
55-
53+
(See also [https://stedolan.github.io/jq](https://stedolan.github.io/jq))
54+
55+
## License
56+
5657
Copyright (c) 2023 Oracle and/or its affiliates.
57-
58+
5859
Licensed under the Universal Permissive License (UPL), Version 1.0.
59-
60+
6061
See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/main/LICENSE) for more details.

0 commit comments

Comments
 (0)