Good Contents Are Everywhere, But Here, We Deliver The Best of The Best.Please Hold on!
When you create a Database Deployment in Oracle Database Cloud Service, the following tasks are completed for you:
  • Compute Node Allocated
  • Storage Allocated
  • Virtual Machine Image Installed
  • Set Keys and Privileges
  • Install and Configure Database
  • Configure Backup
  • Configure Tools
  • Configure Access

Network access to the Compute Node associated with Oracle Database Cloud Service is primarily provided by SSH connections on port 22. By default SSH port 22 is opened to allow access to the tools, utilities and other resources on the Compute Node associated with the Oracle Database Cloud Services. You can use SSH client software such as PuTTY on Windows to establish a secure connection and log in as “opc” or “oracle” user. You can also connect to Compute node using GUI interface, for this you can use VNC.

In this article we will demonstrate how to connect to Compute Node using VNC.

Prerequisites
  • IP address of Compute Node
  • TigerVNC Viewer client software
  • TigerVNC Server package installed on Compute Node


Steps to connect to Oracle Database Cloud Compute Node using VNC on Windows Operating System


  • Login to the Oracle Cloud Compute Node 


Open PuTTY session on your desktop and enter Compute Node IP address


  • On the left pane, expand “SSH” and select “Auth”. On the right pane, click on “Browse” button. Select the Private Key that matches the Public Key for your Deployment. Click “Open”


  • Enter login as “opc”. This will connect you to the compute node without password


  • Switch to root by executing “sudo -s” command. Confirm that you are switched to root by executing “id” command


  • Verify your Operating System version. Here the OS is OEL and version is 6 with update 8


  • Navigate to the yum repository directory and open the public yum repository file


  • In the file look for your operating system version, example ol6_latest and make sure “enabled=1” is set


  1. Next look for operating system base update, example ol6_u8_base and make sure “enabled=1” is set


  • Verify the file is updated successfully


  • Install the Tigervnc* package using the yum utility


  • Type y and hit return


  • We can see that the package installation completed successfully


  • Verify that the package is installed using rpm -qa command


  • Verify if vnc server is running or not as root and oracle user. We can see that vnc server is not running


  • Let’s start the vnc server as oracle users. Enter a password of your choice and verify. From the ‘ps -ef|grep vnc’ command output note down the port numbers :1 and 5901


  • Open Tiger VNC Viewer on your desktop/laptop and enter the port :1


  • Connection failed…. This is because the port 5901 is not opened on the Compute Node. We should open the port 5901 and try again



Follow the procedure below to configure custom Security List and Rules to enable access to specific security applications (VNC application and port range 5901 – 5905) on the compute node.


  • Open a web browser and enter the URL you received in the Welcome email to login to Oracle Cloud Account


  • Enter your username and password


  • On the home page, Click “Menu” under “Compute Classic” Cloud Service as shown below


  • Click “Open Service Console”


  • Click on “Network”


  • Expand “Shared Network”


  • Click “Security Applications” and then “Create Security Application”


  • Enter a Security Application Name, Port Type, Port Range Start, Port Range End and a Description and click Create. In our scenario we are enabling access to VNC application on the ports between 5901 and 5905


  • Make sure the Security Application is created by searching it


  • Click “Security Lists” and then “Create Security List”


  • Enter Security List Name and leave Inbound Policy and Outbound Policy to DEFAULT value and click Create


  • Make sure the Security List is created by searching it


  • Click “Security Rules” and then “Create Security Rule”


  • Enter the details as show below:
Name: Any desired meaningful name
Status: Enabled to enable the rule
Security Application: we create above
Source: Security IP List -> public-internet
Destination: select security list created above from drop down 
Click Create


  • Make sure the Security Rule is created by searching it


  • Click “Instances”


  • Select your Instance and scroll down


  • Click “Add Security List”


  • Select “Security List” create above from the drop down list


  • Make sure the Security List added to your Instance


  • Open VNC on your desktop/Laptop and enter the IP address of your Database Deployment


  • Enter VNC password used at the time of starting VNC server software on the compute node


  • Enter Oracle user password given at the time of configuring VNC Server to connect to the Compute node


  • We are now connected to the compute node in GUI interface using VNC

Enjoy working with Compute Node in GUI mode…


Conclusion
In this article we have learned how to connect to Oracle Cloud Compute Node using VNC in GUI Mode. To accomplish this we need to install Operating System packages and create custom Security List and Rules to enable access to specific security applications (VNC application and port range 5901 – to 5905) on the compute node. Oracle Compute Cloud Service networking create resources to provide network access to the compute node.

3

When a Oracle Database Cloud deployment is created, it creates following 3 OS users:
  1. opc: This user is authorized to login to compute and execute root commands. It can use sudo -s command to switch to root.
  2. root: This user is not authorized to login to the compute node. To perform operations that requires root user access, connect to the compute node as opc user and use the sudo command.
  3. oracle: This user is authorized to login to the compute node and execute user level commands but not root commands.
If you want you can create additional operating system users to login to the compute node. The new user can perform OS standard operations, such as Install, configuring and running applications. You can provide sudo access to this user to execute sudo commands.



In this article we will demonstrate how to create additions OS users and grant the sudo permissions to execute sudo commands.



Steps to create additional OS users on Oracle Cloud Compute Node

Open PuTTY session on your desktop and enter Compute Node IP address


  • On the left pane, expand “SSH” and select “Auth”. On the right pane, click on “Browse” button. Select the Private Key that matches the Public Key for your Deployment. Click “Open”


  • Enter login as “opc”. This will connect you to the compute node without password. Switch to root by executing “sudo -s” command. Confirm that you are switched to root by executing “id” command.


  • Use the “useradd” command to create new user. Here we are creating a new OS user by name “nsmuser”


  • Now create the “.ssh” directory and “authorized_keys” file as shown below.


  • Copy the SSH Public key value from your desktop


  • Paste the SSH public key value to the “authorized_key” file. Save and exit the file


  • Verify the file is created and the contents of the file


  • Add the new user to the allowed users list under “sshd_config” file. Open the “sshd_config” file


  • Add the new user “nsmuser” to the the “Allowusers” line as show below. Save and exit the file


  • Verify the file is modified


  • Change the ownership and permissions of “.ssh” directory as show below. Restart the sshd daemon so the changes made to “sshd_config” can take affect.


  • Add the new user “nsmuser” to the “sudoers” file allow root access. Open the “sudoers” file as shown below


  • Add the line to the sudoers file as shown below


  • Verify that the new user is added to the sudoers file


  • Login to the Compute node using new user created above. Open PuTTY session and enter the Compute Node IP address, select the private key that matches the Public Key for your Deployment


  • Login as “nsmuser”. Execute “sudo -s” to switch to root user



Conclusion


In this article we have learned about cloud database deployment OS users, how to create additional OS user and grant sudoers permissions to execute sudo commands.

2

Network access to the Compute Node associated with Oracle Database Cloud Service is primarily provided by SSH connections on port 22. By default SSH port 22 is opened to allow access to the tools, utilities and other resources on the Compute Node associated with the Oracle Database Cloud Services. You can use SSH client software such as PuTTY on Windows to establish a secure connection and log in as “opc” or “oracle” user.

To access network protocols and services on a compute node by using a port other than port 22, require additional configuration:
  • Enable network access to the port: Use the Oracle Database Cloud Service console to enable access to a port on a compute node.
  • Create an SSH tunnel to the port: Create SSH tunnel enables you to access a specific compute node port by using an SSH connection as the transport mechanism.

To provide network access to the compute node, the following Oracle Compute Cloud Service networking resources are created:
  • A permanent IP reservation named ipreservation is created and associated with the Compute Cloud Service instance (VM).
  • A security list named ora_db is created and associated with the compute node. 
  • The following security applications (port specifications) are created so that they can be used in security rules to enable access to specific ports on the compute node:
    • ora_dbconsole provides TCP access using port 1158
    • ora_dbexpress provides TCP access using port 5500
    • ora_dblistener provides TCP access using the listener port that you specified when you created the database deployment (default 1521)
    • ora_http provides TCP access using port 80
    • ora_httpssl provides TCP access using port 443
  • The following rules are created when a database deployment is created. They are set to disabled by default:
    • ora_p2_ssh: Controls access to port 22 and this port is used by SSH client to connect to the compute node. 
    • ora_p2_dbconsole: Controls access to port 1158 and this port is used by Enterprise Manager 11g Database Control.
    • ora_p2_dbexpress: Controls access to port 5500 and this port is used by Enterprise Manager Database Express 12c.
    • ora_p2_dblistener: Controls access to port 1521 and this port is used by SQL*Net.
    • ora_p2_http: Controls access to port 80 and this port is used for HTTP connections.
    • ora_p2_httpssl: Controls access to port 443 and this port is used for HTTPS connections, including Oracle REST Data Services (ORDS), Oracle Application Express (APEX), and Oracle DBaaS Monitor.

Oracle Database Cloud Service uses access rules to provide secure network access to database deployments. You can use the Oracle Database Cloud Service console to perform network access operations such as enabling and disabling access rules and creating new access rules. 

You can create an access rule to enable ports not associated with a predefined rule, or to restrict access to ports to only permit connections from specific IP addresses. The security list is used in security rules to enable access to specific security applications (port specifications) on the compute node.

In this article we will demonstrate how to create custom Security List and Rules to enable access to specific security applications (VNC application and port range 5901 – 5905) on the compute node.

  • Open a web browser and enter the URL you received in the Welcome email to login to Oracle Cloud Account

https://myservices-xxxxx-xxxxxxxxxxef4b21bb7ee3b2cf4123d1.console.oraclecloud.com/mycloud/faces/dashboard.jspx

  • Enter your username and password

  • On the home page, Click “Menu” under “Compute Classic” Cloud Service as shown below

  • Click “Open Service Console”

  • Click on “Network”

  • Expand “Shared Network”

  • Click “Security Applications” and then “Create Security Application”

  • Enter a Security Application Name, Port Type, Port Range Start, Port Range End and a Description and click Create. In our scenario we are enabling access to VNC application on the ports between 5901 and 5905

  • Make sure the Security Application is created by searching it

  • Click “Security Lists” and then “Create Security List”

  • Enter Security List Name and leave Inbound Policy and Outbound Policy to DEFAULT value and click Create

  • Make sure the Security List is created by searching it

  • Click “Security Rules” and then “Create Security Rule”

  • Enter the details as show below:
Name: Any desired meaningful name
Status: Enabled to enable the rule
Security Application: we create above
Source: Security IP List -> public-internet
Destination: select security list created above from drop down 
Click Create

  • Make sure the Security Rule is created by searching it


  • Click “Instances”

  • Select your Instance and scroll down

  • Click “Add Security List”

  • Select “Security List” create above from the drop down list

  • Make sure the Security List added to your Instance

  • Open VNC on your desktop/Laptop and enter the IP address of your Database Deployment

  • Enter VNC password used at the time of starting VNC server software on the compute node

  • Enter Oracle user password to connect to the Compute node

  • We are now connected to the compute node using VNC




Conclusion

In this article we have learned how to create custom Security List and Rules to enable access to specific security applications (VNC application and port range 5901 – to 5905) on the compute node. Oracle Compute Cloud Service networking create resources to provide network access to the compute node.


0

In the previous article we have demonstrated how to connect to Oracle Database in Oracle Cloud using Oracle SQL Developer when the Oracle Net Listener port 1521 was enabled.

Let’s assume that you DO NOT want to enable the Oracle Net Listener port 1521 for security reasons. In that case you can create an SSH tunnel to port 1521 on the compute node associated with Oracle Database Cloud Service. Then you can use SSH client software that supports tunneling. Oracle SQL Developer supports SSH and it can used to create an SSH tunnel to port 1521 on the compute node if you don’t want to enable port 1521 explicitly.

In this article we will demonstrate how to connect to Oracle Oracle Database in Oracle Cloud using SQL Developer and SSH Tunneling.

Prerequisites

  • IP address of Compute node
  • Database Service name
  • Database username and password to connect to the database
  • Download and unzip SQL Developer software. Use the below link to download latest SQL Developer software
http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html

Steps to connect to Oracle Database in Cloud using Oracle SQL Developer and SSH Tunneling


  • From the below screen shot we can see that SSH port 22 is enabled and Oracle Net Listener port 1521 is disabled


  • Open Oracle SQL Developer on your Desktop/Laptop and Click the Add button


  • Fill in all the details, Connection name, username, password, Host name, Service Name


  • Click “Test” button. As the port 1521 is disabled we can’t connect to the Oracle Database. 
We should use SSH tunneling to establish a successful database connection


  • From  SQL Developer Click “View” menu and select SSH


  • On the left pane, click on SSH host and select “New SSH Host”


  • Fill in all the details, and click OK
Name: Any name of your choice
Host: IP address of Compute node
Username: opc or oracle
Use Key file: Select the private key from your desktop/laptop that matches the Public Key for your Deployment
Name: Any name of your choice
Host: localhost
Port: 1521 used by SQL*Net



  • Now Open Oracle SQL Developer on your Desktop/Laptop and Click the Add button, Fill in all the details, Connection name, username, password, Host name, Service Name and click Test button. We can now see that he Status is Successful. Click connect


  • Execute some SQL Statement to ensure you can fetch the data from database


  • From  SQL Developer Click “View” menu select DBA to display DBA menu on left pane of SQL Developer


  • Under DBA menu click Add button to add database connection. Select a Connection and click OK


  • Navigate to DBA Menu, select your database connection to explore database configuration, status, other DBA options

Conclusion

In this article we have learned how to connect to Oracle Database in Oracle Cloud using Oracle SQL Developer remotely when port 1521 is disabled for security reason. You can create an SSH tunnel to port 1521 on the compute node associated with Oracle Database Cloud Service. Then you can use SSH client software that supports tunneling. Oracle SQL Developer supports SSH and it can used to create an SSH tunnel to port 1521 on the compute node if you don’t want to enable port 1521 explicitly.


0