{"id":30564,"date":"2024-01-29T20:28:00","date_gmt":"2024-01-29T19:28:00","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=30564"},"modified":"2026-02-25T21:29:43","modified_gmt":"2026-02-25T20:29:43","slug":"oci-recover-lost-ssh-access-to-an-ubuntu-instance","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/","title":{"rendered":"OCI &#8211; Recover lost SSH access to an Ubuntu instance"},"content":{"rendered":"\n<p>Getting started in the cloud is pretty easy but things can get a little messy pretty quickly. A few weeks ago, I faced a case where I suddenly lost the SSH access to an Ubuntu OCI instance used internally for Alfresco in the scope of our <a href=\"https:\/\/www.dbi-services.com\/fr\/produits\/yak\/\" target=\"_blank\" rel=\"noreferrer noopener\">YaK<\/a> testing. was suddenly not accessible anymore, neither through the browser nor SSH. This was just a quick testing environment, whose purpose is to get created and destroyed frequently. Therefore, it doesn&#8217;t include any backups or other recovery options. However, I found this case interesting and instead of just scratching the instance to have it back, I thought it could be good to investigate what happened and what can be done on OCI to get your instance back &#8220;online&#8221;.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-1-using-the-oci-local-connection-feature\">1. Using the OCI local connection feature<\/h2>\n\n\n\n<p>I started looking into the <a href=\"https:\/\/docs.oracle.com\/en-us\/iaas\/Content\/Compute\/References\/serialconsole.htm\" target=\"_blank\" rel=\"noreferrer noopener\">documentation of OCI<\/a>. I didn&#8217;t have the necessary permissions to use the &#8220;Console Connection&#8221;, so I asked a colleague to grant me the <a href=\"https:\/\/docs.oracle.com\/en-us\/iaas\/Content\/Compute\/References\/serialconsole.htm#serialconsole_topic_required_iam_policies\" target=\"_blank\" rel=\"noreferrer noopener\">needed IAM Policies<\/a> in the correct compartment:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nAllow group &lt;group_name&gt; to manage instance-console-connection in tenancy\nAllow group &lt;group_name&gt; to read instance in tenancy\n<\/pre><\/div>\n\n\n<p>Once that was done, I was able to <a href=\"https:\/\/docs.oracle.com\/en-us\/iaas\/Content\/Compute\/References\/serialconsole.htm#Connecti2__maclinux\" target=\"_blank\" rel=\"noreferrer noopener\">create a new &#8220;local connection&#8221; SSH access<\/a> for my Mac. Once the connection was created (simply click on &#8220;Create local connection&#8221;; generate or paste your public key and finally click on &#8220;Create console connection&#8221;), I was able to copy the SSH command to connect to my unavailable instance:<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d26f84505ec&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d26f84505ec\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"409\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_1-1024x409.png\" alt=\"Create an OCI instance console connection\" class=\"wp-image-30565\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_1-1024x409.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_1-300x120.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_1-768x307.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_1-1536x613.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_1-2048x818.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>This is the SSH command generated by OCI to be able to connect to the system (where XXX is a random ID for the console connection host and YYY is the random ID of your instance OCID):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nssh -o ProxyCommand=&#039;ssh -W %h:%p -p 443 ocid1.instanceconsoleconnection.oc1.eu-zurich-1.XXX@instance-console.eu-zurich-1.oci.oraclecloud.com&#039; ocid1.instance.oc1.eu-zurich-1.YYY\n<\/pre><\/div>\n\n\n<p>As described in the documentation, since I&#8217;m not using the default SSH key or ssh-agent, then I needed to update that command with my custom private key, to be able to connect. Therefore, the previous command became (add 2 times the &#8220;<em>-i \/path\/to\/private\/key<\/em>&#8220;):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nssh -i ~\/.ssh\/ocilocalshell -o ProxyCommand=&#039;ssh -i ~\/.ssh\/ocilocalshell -W %h:%p -p 443 ocid1.instanceconsoleconnection.oc1.eu-zurich-1.XXX@instance-console.eu-zurich-1.oci.oraclecloud.com&#039; ocid1.instance.oc1.eu-zurich-1.YYY\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"h-2-using-the-local-connection-to-connect-to-the-instance\">2. Using the local connection to connect to the instance?<\/h2>\n\n\n\n<p>At this point, you should see a login prompt, asking you to enter a username. I did have a public\/private key used to connect to the default Ubuntu account of this server but no username\/password. So, when I saw the login prompt, I thought I had a problem with the public\/private key used by the local connection and I tried to change it to use the exact same used by my &#8220;ubuntu&#8221; OS account for this server, hoping for a seamless login. But of course, that didn&#8217;t work. I tried to alter the SSH command in a few ways to understand how this is supposed to work but no luck. The documentation contains this statement:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><\/p>\n<cite>In the Oracle Cloud Infrastructure Console, reboot the instance. You do not need to enter a username or password. If the instance is functional and the connection is active, the serial output appears in your console. If serial output does not appear in the console, the instance operating system is not booting.<\/cite><\/blockquote>\n\n\n\n<p>Therefore, even if this note only talk about displaying the serial output in the console, I still tried to reboot the instance and see how it behaved. Of course, since the SSH connection to the instance was impossible, the reboot command took some time. OCI will wait up to 15 minutes to perform the power-off. The accumulation of all timeouts I assume. In any cases, once the instance reboots, you will see the shutdown and then the startup information. And that&#8217;s all that is indicated in the documentation\u2026 Because yes, it&#8217;s a documentation to have this output displayed on the prompt, not to recover the access to the system!<\/p>\n\n\n\n<p>So, what to do then? Well, we are one step further, since we can see the startup, that means that we might be able to enter the Boot Menu (GRUB), and indeed, there seemed to be a lot of blogs\/videos talking about that on google. I tried that, but without success, multiple times\u2026 After some time, I looked at google again and found the <em>Oracle Doc ID 2987985.1<\/em> and other notes\/comments that appear to mention that it&#8217;s not possible for Ubuntu by default (might be dependent on some versions or something). In conclusion, we need to be able to login to the instance to change the GRUB settings to be able to open the GRUB to fix the issue to be able to login to the instance, nice infinite loop!<\/p>\n\n\n\n<p>That&#8217;s not a viable solution. At that point, I had already spent an hour on this issue and still couldn&#8217;t see any utilities\/features provided by OCI to easily get a local connection to the instance, for ubuntu.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-3-no-possible-ootb-let-s-do-it-the-old-way-then\">3. No possible OOTB? Let&#8217;s do it the old way then<\/h2>\n\n\n\n<p>Since all ports were suddenly closed on this instance, I strongly suspected a human error while trying to update the firewall rules. On OCI, Ubuntu instances comes with iptables by default, but you can add\/enable ufw as well. However, it would still use iptables in the background\u2026 It can happen that, if someone flushes the iptables rules, all ports would then be closed (assuming ufw was configured to defaults to the DROP policy). Please note that unless you save the iptables rules, a simple reboot would allow you to revert to the old set of rules and therefore, have your system back online. To verify if that was indeed the root cause, I only had one solution left: attach the root partition of my faulty instance to another running instance so I can check what&#8217;s going on inside the configuration files.<\/p>\n\n\n\n<p>Let&#8217;s start with this plan.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-1-shutdown-the-current-oci-instance-1\">3.1. Shutdown the current OCI instance #1<\/h3>\n\n\n\n<p>Just trigger a shutdown of the faulty OCI instance #1 and let it do its thing. As mentioned, it can take several minutes (up to 15 minutes) if it is waiting for some OS commands, like un-mounting disks. In this example, I will use an instance named &#8220;sbx-alf-ce&#8221; as #1:<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d26f8451b24&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d26f8451b24\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"420\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_2-1024x420.png\" alt=\"Stop an OCI instance\" class=\"wp-image-30566\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_2-1024x420.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_2-300x123.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_2-768x315.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_2-1536x629.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_2-2048x839.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-2-detach-the-root-partition-from-oci-instance-1\">3.2. Detach the root partition from OCI instance #1<\/h3>\n\n\n\n<p>On the faulty Instance details page, scroll down to the bottom and on the left side, select &#8220;Boot volume&#8221; (Compute &gt; Instances &gt; Instance details &gt; Boot volume). Then copy the &#8220;resource OCID&#8221;, which is the ID of the Boot volume. Mine looked like that: &#8220;ocid1.bootvolume.oc1.eu-zurich-1.ab5heljrrmrkc5e34behkrde5ce3k2flezhh3lsl2trkrs55svtmcos3ymya&#8221;<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d26f84522bf&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d26f84522bf\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"337\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_3-1024x337.png\" alt=\"Detach the boot volume of an instance\" class=\"wp-image-30571\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_3-1024x337.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_3-300x99.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_3-768x253.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_3-1536x505.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_3-2048x674.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>A few seconds after clicking on &#8220;Detach boot volume&#8221;, the State should switch to &#8220;Detached&#8221;.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-3-create-a-new-empty-oci-instance-2\">3.3. Create a new\/empty OCI instance #2<\/h3>\n\n\n\n<p>For this example, I created a new instance &#8220;sbx2-alf-ce&#8221; as #2, still using our YaK. Once done, you can look at its details and make sure you can connect to it properly.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d26f8452b1f&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d26f8452b1f\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"450\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_4-1024x450.png\" alt=\"View an instance details\" class=\"wp-image-30572\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_4-1024x450.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_4-300x132.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_4-768x337.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_4-1536x675.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_4-2048x899.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-4-attach-the-faulty-root-partition-as-a-simple-volume-to-the-newly-created-oci-instance-2\">3.4. Attach the faulty root partition as a simple volume to the newly created OCI instance #2<\/h3>\n\n\n\n<p>On the newly created Instance details page, scroll down to the bottom and on the left side, select &#8220;Attached block volumes&#8221; (Compute &gt; Instances &gt; Instance details &gt; Attached block volumes). In my case, there is already a 100Gb volume created and setup by the YaK for my Alfresco component, but in this case, I don&#8217;t really care about it since I will not use this OCI instance for anything else than just fixing my first one. Of course, I could have removed this, so it&#8217;s not created to begin with.<\/p>\n\n\n\n<p>On this page, click on &#8220;Attach block volume&#8221;. Then you can either select the volume from the list, if you know which one to choose. Or you can just paste the &#8220;resource OCID&#8221; I asked you to copy in section &#8220;3.2.&#8221; above. Select the &#8220;Attachment type&#8221; as &#8220;Paravirtualized&#8221; and leave the &#8220;Access&#8221; to the default &#8220;Read\/write&#8221;, then click on &#8220;Attach&#8221;.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d26f84533b2&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d26f84533b2\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"671\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_5-1024x671.png\" alt=\"Attach the boot volume as a block volume of an OCI instance\" class=\"wp-image-30573\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_5-1024x671.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_5-300x197.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_5-768x503.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_5-1536x1006.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_5-2048x1342.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>When it completes, you should then have the #1 Boot Volume attached as Block Volume of #2:<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d26f8453a15&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d26f8453a15\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"315\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_6-1024x315.png\" alt=\"List of block volumes of an instance\" class=\"wp-image-30574\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_6-1024x315.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_6-300x92.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_6-768x236.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_6-1536x472.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_6-2048x630.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-5-mount-the-disk-on-oci-instance-2\">3.5. Mount the disk on OCI instance #2<\/h3>\n\n\n\n<p>Now, we can connect through SSH to the OCI instance #2 and mount the #1 Boot Volume so we can access its content (again, here I&#8217;m using the YaK but you can connect to it as you prefer, as long as you have root access in the end):<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [1,8,25,31,32]; title: ; notranslate\" title=\"\">\nyak@6073e16b8a87:~$ ssh oci\/sbx2-alf-ce\nWelcome to Ubuntu 22.04.2 LTS (GNU\/Linux 5.15.0-1038-oracle x86_64)\n...\nLast login: Mon Jan 29 13:15:41 2024 from xxx.xxx.xxx.xxx\nubuntu@sbx2-alf-ce:~$\nubuntu@sbx2-alf-ce:~$ sudo su -\nroot@sbx2-alf-ce:~$\nroot@sbx2-alf-ce:~$ lsblk\nNAME                  MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS\nloop0                   7:0    0  55.7M  1 loop \/snap\/core18\/2785\nloop1                   7:1    0 111.9M  1 loop \/snap\/lxd\/24322\nloop2                   7:2    0  63.4M  1 loop \/snap\/core20\/1974\nloop3                   7:3    0  38.7M  1 loop \/snap\/oracle-cloud-agent\/58\nloop4                   7:4    0  53.3M  1 loop \/snap\/snapd\/19457\nsda                     8:0    0  46.6G  0 disk\n\u251c\u2500sda1                  8:1    0  46.5G  0 part \/\n\u251c\u2500sda14                 8:14   0     4M  0 part\n\u2514\u2500sda15                 8:15   0   106M  0 part \/boot\/efi\nsdb                     8:16   0   100G  0 disk\n\u251c\u2500data-optalfresco    253:0    0    20G  0 lvm  \/opt\/alfresco\n\u251c\u2500data-etcoptalfresco 253:1    0    10G  0 lvm  \/etc\/opt\/alfresco\n\u251c\u2500data-varoptalfresco 253:2    0    30G  0 lvm  \/var\/opt\/alfresco\n\u2514\u2500data-varlogalfresco 253:3    0    20G  0 lvm  \/var\/log\/alfresco\nsdc                     8:32   0  46.6G  0 disk\n\u251c\u2500sdc1                  8:33   0  46.5G  0 part\n\u251c\u2500sdc14                 8:46   0     4M  0 part\n\u2514\u2500sdc15                 8:47   0   106M  0 part\nroot@sbx2-alf-ce:~$\nroot@sbx2-alf-ce:~$ ### --&gt; Here it&#039;s sdc1 that needs to be mounted\nroot@sbx2-alf-ce:~$\nroot@sbx2-alf-ce:~$ mkdir \/faulty_root_1\nroot@sbx2-alf-ce:~$ mount \/dev\/sdc1 \/faulty_root_1\nroot@sbx2-alf-ce:~$\n<\/pre><\/div>\n\n\n<p>In case you don&#8217;t have an existing disk on your instance #2, then it would most probably be &#8220;sdb1&#8221; instead. To find it, just look at the &#8220;part&#8221; that isn&#8217;t &#8220;\/&#8221; and that matches the size of the Boot volume we just attached.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-6-check-the-iptables-configuration-files-inside-the-mounted-disk-on-oci-instance-2-not-the-os-files\">3.6. Check the iptables configuration files inside the mounted disk on OCI instance #2 (not the OS files)<\/h3>\n\n\n\n<p>To check the iptables rules that have been saved, you can simply check for the files &#8220;<em>\/etc\/iptables\/rules.v*<\/em>&#8220;. For the rules used on the OCI instance #1, the file would then be &#8220;<em>\/faulty_root_1\/etc\/iptables\/rules.v4<\/em>&#8220;:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [6,7,9,10,12]; title: ; notranslate\" title=\"\">\nroot@sbx2-alf-ce:~$ cd \/faulty_root_1\nroot@sbx2-alf-ce:\/faulty_root_1$\nroot@sbx2-alf-ce:\/faulty_root_1$ ls\nbin  boot  dev  etc  home  lib  lib32  lib64  libx32  lost+found  media  mnt  opt  proc  root  run  sbin  snap  srv  sys  tmp  usr  var\nroot@sbx2-alf-ce:\/faulty_root_1$\nroot@sbx2-alf-ce:\/faulty_root_1$ cat \/faulty_root_1\/etc\/iptables\/rules.v4\n# Generated by iptables-save v1.8.7 on Mon Jan 29 07:34:58 2024\n*filter\n:INPUT DROP &#x5B;2:152]\n:FORWARD DROP &#x5B;0:0]\n:OUTPUT ACCEPT &#x5B;1:176]\n:InstanceServices - &#x5B;0:0]\n:ufw-after-forward - &#x5B;0:0]\n:ufw-after-input - &#x5B;0:0]\n...\n...\n:ufw-user-logging-output - &#x5B;0:0]\n:ufw-user-output - &#x5B;0:0]\nCOMMIT\n# Completed on Mon Jan 29 07:34:58 2024\nroot@sbx2-alf-ce:\/faulty_root_1$\n<\/pre><\/div>\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-7-if-iptables-was-indeed-the-issue-fix-it\">3.7. If iptables was indeed the issue, fix it<\/h3>\n\n\n\n<p>As you can see above, it&#8217;s definitively this issue: the default policy is DROP and there are absolutely no rules present. Therefore, iptables would just reject all incoming requests. A similar issue could happen if your root partition is 100% full, in which case you would need to do some cleanup in this step, like removing old logs for example.<\/p>\n\n\n\n<p>To &#8220;fix&#8221; the iptables, you can just modify the &#8220;<em>rules.v4\/6<\/em>&#8221; files. You can look at the instance #2 file for an example but the minimal thing to add would be to re-enable at least port 22. You should just copy the whole &#8220;<em>InstanceServices<\/em>&#8221; chain section from the current instance #2 (<em>\/etc\/iptables\/rules.v4<\/em>) and put it into the instance #1 file (<em>\/faulty_root_1\/etc\/iptables\/rules.v4<\/em>). If you aren&#8217;t sure about what you are doing, you can also switch the default policy from &#8220;<em>DROP<\/em>&#8221; to &#8220;<em>ACCEPT<\/em>&#8221; in this file. Here is an example of possible configuration:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; highlight: [4,5,7,8,9,10,11,12]; title: ; notranslate\" title=\"\">\nroot@sbx2-alf-ce:\/faulty_root_1$ cat \/faulty_root_1\/etc\/iptables\/rules.v4\n# Generated by iptables-save v1.8.7 on Mon Jan 29 07:34:58 2024\n*filter\n:INPUT ACCEPT &#x5B;0:0]\n:FORWARD ACCEPT &#x5B;0:0]\n:OUTPUT ACCEPT &#x5B;463:49013]\n:InstanceServices - &#x5B;0:0]\n-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT\n-A INPUT -p icmp -j ACCEPT\n-A INPUT -i lo -j ACCEPT\n-A INPUT -p udp --sport 123 -j ACCEPT\n-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT\n-A INPUT -j REJECT --reject-with icmp-host-prohibited\n-A FORWARD -j REJECT --reject-with icmp-host-prohibited\n-A OUTPUT -d 169.254.0.0\/16 -j InstanceServices\n-A InstanceServices -d 169.254.0.2\/32 -p tcp -m owner --uid-owner 0 -m tcp --dport 3260 -m comment --comment &quot;See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule&quot; -j ACCEPT\n-A InstanceServices -d 169.254.2.0\/24 -p tcp -m owner --uid-owner 0 -m tcp --dport 3260 -m comment --comment &quot;See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule&quot; -j ACCEPT\n...\n...\n-A InstanceServices -d 169.254.0.0\/16 -p tcp -m tcp -m comment --comment &quot;See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule&quot; -j REJECT --reject-with tcp-reset\n-A InstanceServices -d 169.254.0.0\/16 -p udp -m udp -m comment --comment &quot;See the Oracle-Provided Images section in the Oracle Cloud Infrastructure documentation for security impact of modifying or removing this rule&quot; -j REJECT --reject-with icmp-port-unreachable\n:ufw-after-forward - &#x5B;0:0]\n:ufw-after-input - &#x5B;0:0]\n:ufw-after-logging-forward - &#x5B;0:0]\n...\n...\n:ufw-user-logging-input - &#x5B;0:0]\n:ufw-user-logging-output - &#x5B;0:0]\n:ufw-user-output - &#x5B;0:0]\nCOMMIT\n# Completed on Mon Jan 29 07:34:58 2024\nroot@sbx2-alf-ce:\/faulty_root_1$\n<\/pre><\/div>\n\n\n<p>Please note that OCI will add a lot of stuff inside the &#8220;Chain InstanceServices&#8221;, for its internal management (c.f. the &#8220;Oracle-Provided Images&#8221; section of the OCI documentation, <a href=\"https:\/\/docs.oracle.com\/en-us\/iaas\/Content\/Compute\/References\/images.htm#image-firewall-rules\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>) and that&#8217;s also why it is recommended to not use UFW on OCI.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-8-un-mount-the-disk-and-detach-it-from-oci-instance-2\">3.8. Un-mount the disk and detach it from OCI instance #2<\/h3>\n\n\n\n<p>Once you are satisfied with the status of the needed files (whether it&#8217;s iptables or logs for disk full cases), then the next step would be to go back into the initial situation. For that, we first unmount it:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nroot@sbx2-alf-ce:\/faulty_root_1$ cd\nroot@sbx2-alf-ce:~$\nroot@sbx2-alf-ce:~$ umount \/faulty_root_1\nroot@sbx2-alf-ce:~$\nroot@sbx2-alf-ce:~$ rmdir \/faulty_root_1\nroot@sbx2-alf-ce:~$\n<\/pre><\/div>\n\n\n<p>And then we can detach it from the OCI instance #2:<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d26f8454649&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d26f8454649\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"321\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_7-1024x321.png\" alt=\"Detach a block volume from an instance\" class=\"wp-image-30575\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_7-1024x321.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_7-300x94.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_7-768x241.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_7-1536x481.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_7-2048x641.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-9-re-attach-the-root-partition-on-oci-instance-1-and-start-again\">3.9. Re-attach the root partition on OCI instance #1 and start again<\/h3>\n\n\n\n<p>The last step, if everything went well, is to re-attach the Boot volume to where it belonged at the beginning. So go back to the Instance details page of the OCI instance #1, scroll down to the bottom and on the left side, select &#8220;Boot volume&#8221; (Compute &gt; Instances &gt; Instance details &gt; Boot volume). You should still see in the &#8220;Detached&#8221; State. Just click on &#8220;Attach boot volume&#8221; to get it back in the &#8220;Attached&#8221; State:<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;69d26f8454cfe&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"69d26f8454cfe\" class=\"wp-block-image size-large wp-lightbox-container\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"314\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_8-1024x314.png\" alt=\"Re-attach the boot volume to an instance\" class=\"wp-image-30576\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_8-1024x314.png 1024w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_8-300x92.png 300w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_8-768x236.png 768w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_8-1536x471.png 1536w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_8-2048x629.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\taria-label=\"Enlarge\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.imageButtonRight\"\n\t\t\tdata-wp-style--top=\"state.imageButtonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p>Once re-attached, you can start your OCI instance #1 again and you should now be able to login as you did before the issue started:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nyak@6073e16b8a87:~$ ssh oci\/sbx-alf-ce\nWelcome to Ubuntu 22.04.2 LTS (GNU\/Linux 5.15.0-1038-oracle x86_64)\n...\nLast login: Mon Jan 29 07:25:22 2024 from xxx.xxx.xxx.xxx\nubuntu@sbx-alf-ce:~$\n<\/pre><\/div>\n\n\n<p>If you still have some issues, there was probably some errors done on the configuration files. You can restart the process again (shutdown #1, detach, attach on #2, etc\u2026).<\/p>\n\n\n\n<p>Note that it is also possible to script all that and use the OCI CLI (command line) instead. For that purpose, you will need the Instance #1 and #2 OCIDs as well as the Boot volume OCID. Then you can use commands such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Detach from OCI Instance #1: <em>oci compute boot-volume-attachment detach &#8211;boot-volume-attachment-id ${instance_1_OCID}<\/em><\/li>\n\n\n\n<li>Attach to OCI Instance #2: <em>oci compute volume-attachment attach &#8211;instance-id ${instance_2_OCID} &#8211;volume-id ${boot_volume_OCID} &#8211;type paravirtualized<\/em><\/li>\n<\/ul>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Getting started in the cloud is pretty easy but things can get a little messy pretty quickly. A few weeks ago, I faced a case where I suddenly lost the SSH access to an Ubuntu OCI instance used internally for Alfresco in the scope of our YaK testing. was suddenly not accessible anymore, neither through [&hellip;]<\/p>\n","protected":false},"author":20,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[955,2966,2721],"tags":[135,1375,1361,2717],"type_dbi":[3189,3156,3240,3239],"class_list":["post-30564","post","type-post","status-publish","format-standard","hentry","category-cloud","category-oci","category-yak","tag-cloud","tag-oci","tag-ssh","tag-yak-2","type-cloud","type-oci","type-ssh","type-yak"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>OCI - Recover lost SSH access to an Ubuntu instance - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"OCI - Recover lost SSH access to an Ubuntu instance\" \/>\n<meta property=\"og:description\" content=\"Getting started in the cloud is pretty easy but things can get a little messy pretty quickly. A few weeks ago, I faced a case where I suddenly lost the SSH access to an Ubuntu OCI instance used internally for Alfresco in the scope of our YaK testing. was suddenly not accessible anymore, neither through [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-29T19:28:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-25T20:29:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2507\" \/>\n\t<meta property=\"og:image:height\" content=\"1001\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Morgan Patou\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@MorganPatou\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Morgan Patou\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/\"},\"author\":{\"name\":\"Morgan Patou\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c4d05b25843a9bc2ab20415dae6bd2d8\"},\"headline\":\"OCI &#8211; Recover lost SSH access to an Ubuntu instance\",\"datePublished\":\"2024-01-29T19:28:00+00:00\",\"dateModified\":\"2026-02-25T20:29:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/\"},\"wordCount\":1918,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_1-1024x409.png\",\"keywords\":[\"Cloud\",\"OCI\",\"ssh\",\"yak\"],\"articleSection\":[\"Cloud\",\"OCI\",\"YaK\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/\",\"name\":\"OCI - Recover lost SSH access to an Ubuntu instance - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_1-1024x409.png\",\"datePublished\":\"2024-01-29T19:28:00+00:00\",\"dateModified\":\"2026-02-25T20:29:43+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c4d05b25843a9bc2ab20415dae6bd2d8\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/#primaryimage\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_1.png\",\"contentUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_1.png\",\"width\":2507,\"height\":1001},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"OCI &#8211; Recover lost SSH access to an Ubuntu instance\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c4d05b25843a9bc2ab20415dae6bd2d8\",\"name\":\"Morgan Patou\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/5d7f5bec8b597db68a09107a6f5309e3870d6296ef94fb10ead4b09454ca67e5?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5d7f5bec8b597db68a09107a6f5309e3870d6296ef94fb10ead4b09454ca67e5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5d7f5bec8b597db68a09107a6f5309e3870d6296ef94fb10ead4b09454ca67e5?s=96&d=mm&r=g\",\"caption\":\"Morgan Patou\"},\"description\":\"Morgan Patou has over 12 years of experience in Enterprise Content Management (ECM) systems, with a strong focus in recent years on platforms such as Alfresco, Documentum, and M-Files. He specializes in the architecture, setup, customization, and maintenance of ECM infrastructures in complex &amp; critical environments. Morgan is well-versed in both engineering and operations aspects, including high availability design, system integration, and lifecycle management. He also has a solid foundation in open-source and proprietary technologies - ranging from Apache, OpenLDAP or Kerberos to enterprise-grade systems like WebLogic. Morgan Patou holds an Engineering Degree in Computer Science from ENSISA (\u00c9cole Nationale Sup\u00e9rieure d'Ing\u00e9nieurs Sud Alsace) in Mulhouse, France. He is Alfresco Content Services Certified Administrator (ACSCA), Alfresco Content Services Certified Engineer (ACSCE) as well as OpenText Documentum Certified Administrator. His industry experience spans the Public Sector, IT Services, Financial Services\/Banking, and the Pharmaceutical industry.\",\"sameAs\":[\"https:\/\/blog.dbi-services.com\/author\/morgan-patou\/\",\"https:\/\/x.com\/MorganPatou\"],\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/morgan-patou\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"OCI - Recover lost SSH access to an Ubuntu instance - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/","og_locale":"en_US","og_type":"article","og_title":"OCI - Recover lost SSH access to an Ubuntu instance","og_description":"Getting started in the cloud is pretty easy but things can get a little messy pretty quickly. A few weeks ago, I faced a case where I suddenly lost the SSH access to an Ubuntu OCI instance used internally for Alfresco in the scope of our YaK testing. was suddenly not accessible anymore, neither through [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/","og_site_name":"dbi Blog","article_published_time":"2024-01-29T19:28:00+00:00","article_modified_time":"2026-02-25T20:29:43+00:00","og_image":[{"width":2507,"height":1001,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_1.png","type":"image\/png"}],"author":"Morgan Patou","twitter_card":"summary_large_image","twitter_creator":"@MorganPatou","twitter_misc":{"Written by":"Morgan Patou","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/"},"author":{"name":"Morgan Patou","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c4d05b25843a9bc2ab20415dae6bd2d8"},"headline":"OCI &#8211; Recover lost SSH access to an Ubuntu instance","datePublished":"2024-01-29T19:28:00+00:00","dateModified":"2026-02-25T20:29:43+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/"},"wordCount":1918,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_1-1024x409.png","keywords":["Cloud","OCI","ssh","yak"],"articleSection":["Cloud","OCI","YaK"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/","url":"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/","name":"OCI - Recover lost SSH access to an Ubuntu instance - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_1-1024x409.png","datePublished":"2024-01-29T19:28:00+00:00","dateModified":"2026-02-25T20:29:43+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c4d05b25843a9bc2ab20415dae6bd2d8"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_1.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2024\/01\/blog_oci_1.png","width":2507,"height":1001},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/oci-recover-lost-ssh-access-to-an-ubuntu-instance\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"OCI &#8211; Recover lost SSH access to an Ubuntu instance"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/c4d05b25843a9bc2ab20415dae6bd2d8","name":"Morgan Patou","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5d7f5bec8b597db68a09107a6f5309e3870d6296ef94fb10ead4b09454ca67e5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5d7f5bec8b597db68a09107a6f5309e3870d6296ef94fb10ead4b09454ca67e5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5d7f5bec8b597db68a09107a6f5309e3870d6296ef94fb10ead4b09454ca67e5?s=96&d=mm&r=g","caption":"Morgan Patou"},"description":"Morgan Patou has over 12 years of experience in Enterprise Content Management (ECM) systems, with a strong focus in recent years on platforms such as Alfresco, Documentum, and M-Files. He specializes in the architecture, setup, customization, and maintenance of ECM infrastructures in complex &amp; critical environments. Morgan is well-versed in both engineering and operations aspects, including high availability design, system integration, and lifecycle management. He also has a solid foundation in open-source and proprietary technologies - ranging from Apache, OpenLDAP or Kerberos to enterprise-grade systems like WebLogic. Morgan Patou holds an Engineering Degree in Computer Science from ENSISA (\u00c9cole Nationale Sup\u00e9rieure d'Ing\u00e9nieurs Sud Alsace) in Mulhouse, France. He is Alfresco Content Services Certified Administrator (ACSCA), Alfresco Content Services Certified Engineer (ACSCE) as well as OpenText Documentum Certified Administrator. His industry experience spans the Public Sector, IT Services, Financial Services\/Banking, and the Pharmaceutical industry.","sameAs":["https:\/\/blog.dbi-services.com\/author\/morgan-patou\/","https:\/\/x.com\/MorganPatou"],"url":"https:\/\/www.dbi-services.com\/blog\/author\/morgan-patou\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/30564","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=30564"}],"version-history":[{"count":13,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/30564\/revisions"}],"predecessor-version":[{"id":43182,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/30564\/revisions\/43182"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=30564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=30564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=30564"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=30564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}