Info Security Memo
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org

Build Confidence

Focusing on Information Security 

Info Security Notes

Oracle Cloud VPS VNC Console Connection

8/8/2021

0 Comments

 
Oracle Cloud VPS VNC Console Connection

Oracle Cloud Infrastructure Compute service provides console connections that enable a user to remotely troubleshooting malfunctioning instances using:

  • Serial Console Connections
  • VNC Console Connections

In this post, I am going to focus on VNC console connections. 

The VNC console connection uses SSH port forwarding to create a secure connection from your local system to the VNC server attached to your instance's console.


Use Cases

  • Add or reset SSH Keys for the OPC user
  • Edit system configuration files
  • An imported or customized image that does not complete a successful boot (such as DD another image)
  • A previously working instance that stops responding



Linux Topology





Pre-requisites for Creating VNC Console Connection

1. Install VNC Viewer on client machine from : https://ift.tt/3Cwq7Gr

2. On Linux Server for SSH Tunneling

2.1 Generate SSH Key using ssh-keygen command. Press enter until completed.

2.2 Copy  /root/.ssh/id_rsa.pub content, which is the public key we will paste it into Oracle cloud platform instance's VNC console connection.

2.3 Stop Linux firewall or add an firewall rule to allow VNC traffic


# systemctl status firewalld
# service firewalld stop
OR
# systemctl stop firewalld



Linux


In OCI, navigate to your instance. In the lower left you’ll notice the Resources menu. Choose the Console Connections option.


This brings up the Console Connections dialog. Click on the “Create Console Connection” button to create a new connection. You’ll see the connection being provisioned and created.




At this point look to the far right of the connection and notice three dots. Hover over them to reveal the connection options. You’ll see Connect with SSH and Connect with VNC listed.

For users that need a graphical connection to the host, use VNC. The steps to establish a VNC connection are the similar to those for connecting to SSH. Create a connection and hover over the three dots at the far right of the connection. Here, choose Connect with VNC. A very similar dialog box appears, with similar choices for selecting Linux/Mac or Windows.

Again, copy the connection string.



This command is slightly different. Rather than creating a connection, it builds an SSH tunnel to OCI by adding an additional option to the SSH command in the middle:

ssh -o ProxyCommand='ssh -W %h:%p -p 443 ocid1.instanceconsoleconnection.oc1.ca-toronto-1.an2g6ljrj7xw6qyctvjlznddiuci4olyx3kiu2hsq53kvukbll6o3uvojzfa@instance-console.ca-toronto-1.oci.oraclecloud.com' -N -L localhost:5900:ocid1.instance.oc1.ca-toronto-1.an2g6ljrj7xw6qyczmpx2ntlkwbnzgnx2ekxwwbqfnr7narfaeeydbj3jwaa:5900 ocid1.instance.oc1.ca-toronto-1.an2g6ljrj7xw6qyczmpx2ntlkwbnzgnx2ekxwwbqfnr7narfaeeydbj3jwaa

-N -L localhost:5900:ocid1.instance.oc1.redacted:5900

changed to

-N -L 0.0.0.0:5900:ocid1.instance.oc1.redacted:5900

ssh -o ProxyCommand='ssh -W %h:%p -p 443 ocid1.instanceconsoleconnection.oc1.ca-toronto-1.an2g6ljrj7xw6qyctvjlznddiuci4olyx3kiu2hsq53kvukbll6o3uvojzfa@instance-console.ca-toronto-1.oci.oraclecloud.com' -N -L 0.0.0.0:5900:ocid1.instance.oc1.ca-toronto-1.an2g6ljrj7xw6qyczmpx2ntlkwbnzgnx2ekxwwbqfnr7narfaeeydbj3jwaa:5900 ocid1.instance.oc1.ca-toronto-1.an2g6ljrj7xw6qyczmpx2ntlkwbnzgnx2ekxwwbqfnr7narfaeeydbj3jwaa


Without going into too much detail, (-N) tells SSH not to run a command; and (-L) redirects (forwards) traffic sent to port 5900 on the local host to port 5900 on the OCI host. Edit these values If VNC is running on a different port either locally or remotely. 

If your VPS is in the cloud, certain cloud providers might use NAT method to assign your VPS ip address, in that case you might need to you local ip address instead localhost. 




[root@localhost ~]# ssh -o ProxyCommand='ssh -W %h:%p -p 443 ocid1.instanceconso leconnection.oc1.ca-toronto-1.an2g6ljrj7xw6qyctvjlznddiuci4olyx3kiu2hsq53kvukbll [email protected]' -N -L 0.0.0.0:5900 :ocid1.instance.oc1.ca-toronto-1.an2g6ljrj7xw6qyczmpx2ntlkwbnzgnx2ekxwwbqfnr7nar faeeydbj3jwaa:5900 ocid1.instance.oc1.ca-toronto-1.an2g6ljrj7xw6qyczmpx2ntlkwbnz gnx2ekxwwbqfnr7narfaeeydbj3jwaa



=================================================


IMPORTANT: Use a console connection to troubleshoot a malfunctioning instance. F or normal operations, you should connect to the instance using a Secure Shell (S SH) or Remote Desktop connection. For steps, see https://docs.cloud.oracle.com/i aas/Content/Compute/Tasks/accessinginstance.htm

For more information about troubleshooting your instance
using a console connect ion, see the documentation: https://docs.cloud.oracle.com/en-us/iaas/Content/Com pute/References/serialconsole.htm#four

=================================================

When you run this command it won’t appear to do anything. That’s normal. It’s actively tunneling traffic as long as it’s running. Ctl-C will return control of the session but any VNC session running locally will be lost.



Windows


tbc.








via Blogger https://ift.tt/3s4w889
August 08, 2021 at 07:15PM Cloud
0 Comments



Leave a Reply.

    Categories

    All
    Architecture
    Blog
    Checkpoint
    Cisco
    Cloud
    CyberArk
    F5
    Fortigate
    Guardium
    Juniper
    Linux
    Network
    Others
    Palo Alto
    Qualys
    Raspberry Pi
    Security
    SIEM
    Software
    Vmware
    VPN
    Wireless

    Archives

    March 2024
    February 2024
    January 2024
    December 2023
    November 2023
    October 2023
    September 2023
    August 2023
    July 2023
    June 2023
    May 2023
    April 2023
    March 2023
    February 2023
    January 2023
    December 2022
    November 2022
    October 2022
    September 2022
    August 2022
    July 2022
    June 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    October 2019
    September 2019
    June 2019
    July 2018
    May 2018
    December 2017
    August 2017
    April 2017
    March 2017
    January 2017
    December 2016
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015
    September 2015
    August 2015
    July 2015
    June 2015
    May 2015
    April 2015
    March 2015

    Print Page:

    RSS Feed

    Email Subscribe
Powered by Create your own unique website with customizable templates.
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org