{"id":4955,"date":"2023-12-04T11:18:03","date_gmt":"2023-12-04T19:18:03","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=4955"},"modified":"2023-12-04T11:18:04","modified_gmt":"2023-12-04T19:18:04","slug":"how-to-connect-a-linux-instance-on-oracle-cloud","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=4955","title":{"rendered":"How to Connect a Linux Instance on Oracle Cloud"},"content":{"rendered":"\n<p>You connect to a running Linux instance by using a Secure Shell (SSH) connection.<\/p>\n\n\n\n<p>The steps to connect to a Linux instance vary, depending on the operating system that you&#8217;re connecting from.<\/p>\n\n\n\n<p>Most UNIX-style systems include an SSH client by default. Windows 10 and Windows Server 2019 systems should include the\u00a0<a href=\"https:\/\/docs.microsoft.com\/windows-server\/administration\/openssh\/openssh_install_firstuse\" target=\"_blank\" rel=\"noreferrer noopener\">OpenSSH client<\/a>, which you need if you created your instance using the SSH keys generated by\u00a0Oracle Cloud Infrastructure. For other Windows versions, you can download a free SSH client called PuTTY from\u00a0<a href=\"http:\/\/www.putty.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/www.putty.org<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ariaid-title4\">Connecting to a Linux Instance from a Windows System Using OpenSSH<\/h2>\n\n\n\n<p>If the instance uses a key pair that was generated by&nbsp;Oracle Cloud Infrastructure, then use the following procedure.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>If this is the first time you are using this key pair, then you must set the file permissions so that only you can read the file. Do the following:<ol type=\"a\"><li>In Windows Explorer, navigate to the private key file, right-click the file, and then click&nbsp;<strong>Properties<\/strong>.<\/li><li>On the&nbsp;<strong>Security<\/strong>&nbsp;tab, click&nbsp;<strong>Advanced<\/strong>.<\/li><li>On the&nbsp;<strong>Permissions<\/strong>&nbsp;tab, for&nbsp;<strong>Permission entries<\/strong>, under&nbsp;<strong>Principal<\/strong>, ensure that your user account is listed.<\/li><li>Click&nbsp;<strong>Disable Inheritance<\/strong>, and then select&nbsp;<strong>Convert inherited permissions into explicit permissions on this object<\/strong>.<\/li><li>For&nbsp;<strong>Permission entries<\/strong>, select each permission entry that is not your user account and click&nbsp;<strong>Remove<\/strong>.<\/li><li>Ensure that the access permission for your user account is&nbsp;<strong>Full control<\/strong>.<\/li><li>Save your changes.<\/li><\/ol><\/li><li>To connect to the instance, open Windows PowerShell and run the following command:<strong>&nbsp;Note<\/strong>Copy the following example to ensure the correct characters are used. If the wrong character is used in&nbsp;<code>ssh -i<\/code>, an error such as&nbsp;<code>Could not resolve hostname ...: No such host is known<\/code>&nbsp;might occur.Copy<code>ssh -i <var>&lt;private_key_file&gt;<\/var> <var>&lt;username&gt;<\/var>@<var>&lt;public-ip-address&gt;<\/var><\/code><var>&lt;private_key_file&gt;<\/var>&nbsp;is the full path and name of the&nbsp;<code>.key<\/code>&nbsp;file that contains the private key associated with the instance you want to access.<var>&lt;username&gt;<\/var>&nbsp;is the default username for the instance. For Oracle Linux and CentOS images, the default username is&nbsp;<code>opc<\/code>. For Ubuntu images, the default username is&nbsp;<code>ubuntu<\/code>.<var>&lt;public-ip-address&gt;<\/var>&nbsp;is the instance&#8217;s IP&nbsp;address that you retrieved from the&nbsp;Console.<\/li><li>If you&#8217;re connecting to this instance for the first time, you need to accept the fingerprint of the key. To accept the fingerprint, type&nbsp;<strong>yes<\/strong>&nbsp;and press&nbsp;<strong>Enter<\/strong>.<\/li><\/ol>\n\n\n\n<p><strong>&nbsp;Note<\/strong><\/p>\n\n\n\n<p>For SSH troubleshooting suggestions, see&nbsp;<a href=\"https:\/\/docs.oracle.com\/en-us\/iaas\/Content\/Compute\/Tasks\/troubleshooting-ssh-connection.htm#troubleshooting-ssh-connection\">Troubleshooting the SSH Connection<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ariaid-title5\">Connecting to a Linux Instance from a Windows System Using PuTTY<\/h2>\n\n\n\n<p>SSH private key files generated by&nbsp;Oracle Cloud Infrastructure&nbsp;are not compatible with PuTTY. If you use a private key file that was generated during the instance creation process, you must convert the file to a&nbsp;<code>.ppk<\/code>&nbsp;file before you can use it with PuTTY to connect to the instance.<\/p>\n\n\n\n<p><strong>&nbsp;Note<\/strong><\/p>\n\n\n\n<p>If you changed the file permissions on the key to connect from a Windows system using OpenSSH, then the key will not work with a PuTTY connection.&nbsp;<a href=\"https:\/\/docs.oracle.com\/en-us\/iaas\/Content\/Compute\/Tasks\/connect-to-linux-instance.htm#linux-from-windows-openssh\">Use OpenSSH to connect instead<\/a>.<\/p>\n\n\n\n<p><strong>Convert a generated .key private key file:<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Open PuTTYgen.<\/li><li>Click&nbsp;<strong>Load<\/strong>, and select the private key that was generated when you created the instance. The extension for the key file is&nbsp;<code>.key<\/code>.<\/li><li>Click&nbsp;<strong>Save private key<\/strong>.<\/li><li>Specify a name for the key. The extension for new private key is&nbsp;<code>.ppk<\/code>.<\/li><li>Click&nbsp;<strong>Save<\/strong>.<strong>&nbsp;Note<\/strong>PuTTYgen does not overwrite the&nbsp;<code>.key<\/code>&nbsp;file but creates an additional file of the same name with the&nbsp;<code>.ppk<\/code>&nbsp;extension.<\/li><\/ol>\n\n\n\n<p><strong>Connect to the Linux instance using a .ppk private key file:<\/strong><\/p>\n\n\n\n<p>If the instance uses a key pair that you created using PuTTY Key Generator, use the following procedure.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Open PuTTY.<\/li><li>In the&nbsp;<strong>Category<\/strong>&nbsp;pane, select&nbsp;<strong>Session<\/strong>&nbsp;and enter the following:<ul><li><strong>Host Name (or IP address):<\/strong>Copy<code><var>&lt;username&gt;<\/var>@<var>&lt;public-ip-address&gt;<\/var><\/code><var>&lt;username&gt;<\/var>&nbsp;is the default username for the instance. For Oracle Linux and CentOS images, the default username is&nbsp;<code>opc<\/code>. For Ubuntu images, the default username is&nbsp;<code>ubuntu<\/code>.<var>&lt;public-ip-address&gt;<\/var>&nbsp;is the instance&#8217;s public IP&nbsp;address that you retrieved from the&nbsp;Console<\/li><li><strong>Port:<\/strong>&nbsp;22<\/li><li><strong>Connection type:<\/strong>&nbsp;SSH<\/li><\/ul><\/li><li>In the&nbsp;<strong>Category<\/strong>&nbsp;pane, expand&nbsp;<strong>Window<\/strong>, and then select&nbsp;<strong>Translation<\/strong>.<\/li><li>In the&nbsp;<strong>Remote character set<\/strong>&nbsp;menu, select&nbsp;<strong>UTF-8<\/strong>. The default locale setting on Linux-based instances is UTF-8, and this configures PuTTY to use the same locale.<\/li><li>In the&nbsp;<strong>Category<\/strong>&nbsp;pane, expand&nbsp;<strong>Connection<\/strong>, expand&nbsp;<strong>SSH<\/strong>, expand&nbsp;<strong>Auth<\/strong>, and click&nbsp;<strong>Credentials<\/strong>.<\/li><li>Click&nbsp;<strong>Browse<\/strong>, and then select the&nbsp;<code>.ppk<\/code>&nbsp;private key file.<\/li><li>Click&nbsp;<strong>Open<\/strong>&nbsp;to start the session.If this is the first time connecting to the instance, then you might receive a message that the server&#8217;s host key is not cached in the registry. Click&nbsp;<strong>Yes<\/strong>&nbsp;to continue the connection.<\/li><\/ol>\n\n\n\n<p><strong>&nbsp;Note<\/strong><\/p>\n\n\n\n<p>If the connection fails and you are not behind a proxy, then ensure that&nbsp;<strong>Proxy type<\/strong>&nbsp;in the PuTTY configuration is set to&nbsp;<strong>None<\/strong>. If you are behind a proxy, then select the proxy type and enter the proxy host name and port number. See also&nbsp;<a href=\"https:\/\/docs.oracle.com\/en-us\/iaas\/Content\/Compute\/Tasks\/troubleshooting-ssh-connection.htm#troubleshooting-ssh-connection__update-putty-tool\">Update PuTTY tool<\/a>&nbsp;for other PuTTY issues.<\/p>\n\n\n\n<p><strong>&nbsp;Note<\/strong><\/p>\n\n\n\n<p>For SSH troubleshooting suggestions, see\u00a0<a href=\"https:\/\/docs.oracle.com\/en-us\/iaas\/Content\/Compute\/Tasks\/troubleshooting-ssh-connection.htm#troubleshooting-ssh-connection\">Troubleshooting the SSH Connection<\/a>.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Ref: <a href=\"https:\/\/docs.oracle.com\/en-us\/iaas\/Content\/Compute\/Tasks\/connect-to-linux-instance.htm#top\">Connecting to a Linux Instance (oracle.com)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You connect to a running Linux instance by using a Secure Shell (SSH) connection. The steps to connect to a Linux instance vary, depending on the operating system that you&#8217;re connecting from. Most UNIX-style systems include an SSH client by default. Windows 10 and Windows Server 2019 systems should include the\u00a0OpenSSH client, which you need <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=4955\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[238,1719],"tags":[1720],"class_list":["post-4955","post","type-post","status-publish","format-standard","hentry","category-cloud","category-oracle","tag-connect-a-instance-on-oracle-cloud"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4955","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4955"}],"version-history":[{"count":1,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4955\/revisions"}],"predecessor-version":[{"id":4956,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/4955\/revisions\/4956"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4955"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4955"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4955"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}