<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PuTTY &#8211; CodePills.com</title>
	<atom:link href="https://codepills.com/tag/putty/feed/" rel="self" type="application/rss+xml" />
	<link>https://codepills.com</link>
	<description>Helping you make a better code</description>
	<lastBuildDate>Sat, 23 Mar 2024 12:23:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>How to connect to an EC2 instance over SSH</title>
		<link>https://codepills.com/how-to-connect-to-an-ec2-instance-over-ssh/</link>
					<comments>https://codepills.com/how-to-connect-to-an-ec2-instance-over-ssh/#respond</comments>
		
		<dc:creator><![CDATA[Andrej Buday]]></dc:creator>
		<pubDate>Fri, 01 Mar 2024 09:10:48 +0000</pubDate>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[EC2 instance]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PuTTY]]></category>
		<category><![CDATA[PuTTYgen]]></category>
		<category><![CDATA[remote access]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[SSH client]]></category>
		<category><![CDATA[windows]]></category>
		<guid isPermaLink="false">https://codepills.com/?p=1412</guid>

					<description><![CDATA[The article outlines connecting to an Amazon EC2 instance via SSH, detailing prerequisites and steps for Unix-based systems as well as Windows users, including PuTTY private key conversion. <a href="https://codepills.com/how-to-connect-to-an-ec2-instance-over-ssh/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>This article is a simple guide detailing the prerequisites and step-by-step procedures for connecting to EC2 instances via SSH. It covers Unix-based systems and Windows users, including the conversion of private key files for PuTTY.</p>
<p><span id="more-1412"></span></p>
<h2>Introduction</h2>
<p>SSH (Secure Shell) is a popular, secure protocol for remote access to servers and other network devices. When you launch an EC2 instance, you can connect to it using SSH to manage the server, install and update software, configure settings, and perform other administrative tasks.</p>
<ul>
<li id="prerequisites">Prerequisites</li>
<li id="connecting-over-unix-based-systems">Connecting over Unix-based systems</li>
<li id="connecting-over-windows">Connecting over Windows</li>
</ul>
<h2 id="prerequisites">Prerequisites</h2>
<p>Before you can connect to an EC2 instance over SSH, you need the following:</p>
<ul>
<li>Running EC2 instance and accessible over the network.</li>
<li>The EC2 instance&#8217;s IP address or public DNS.</li>
<li>The appropriate security group configured to allow SSH access (port 22) from your IP address or network.</li>
<li>The private key file (.pem) corresponding to the key pair used when launching the instance.</li>
</ul>
<p>Remember to keep your private key file secure and not share it with anyone. It is the key to accessing your EC2 instance.</p>
<p>If you encounter any issues while connecting, double-check that your instance is running, that the security group allows SSH access from your IP address, or that you are using the correct private key file.</p>
<h2 id="connecting-over-unix-based-systems">Connecting over Unix-based systems</h2>
<p>To connect to your EC2 instance via SSH at Unix-based systems like Linux, macOS, or others, follow these steps:</p>
<h3>Locate the private key file</h3>
<p>Find the private key file (.pem) you downloaded when you created the EC2 instance.</p>
<p>Make sure you have the correct permissions to use the private key file. On Linux or macOS, you can set the permissions using the command:</p>
<pre><code class="language-bash">chmod 400 /path/to/your/private-key.pem</code></pre>
<h3>Connect to the EC2 instance using SSH</h3>
<p>Open a terminal or command prompt and use the `ssh` command to connect to your EC2 instance:</p>
<pre><code class="language-bash">ssh -i /path/to/your/private-key.pem ec2-user@&lt;public-dns-or-ip&gt;</code></pre>
<ul>
<li>Replace <code>/path/to/your/private-key.pem</code> with the real path to your private key file.</li>
<li>Replace <code>&lt;public-dns-or-ip&gt;</code> with the public DNS or IP address of your EC2 instance.</li>
<li>If you&#8217;re using a different username than <b>ec2-user</b> (e.g., for Ubuntu instances, it&#8217;s usually <b>ubuntu</b>), modify the command accordingly.</li>
</ul>
<p>Here&#8217;s an example of the SSH command:</p>
<pre><code class="language-bash"> ssh -i ~/Downloads/my-key-pair.pem ec2-user@ec2-1-25-67-980.us-west-2.compute.amazonaws.com</code></pre>
<h3>Accept the server&#8217;s host key</h3>
<p>If it&#8217;s your first time connecting to the instance, the server may prompt you to accept its host key. Type <i>yes</i> and press Enter to continue.</p>
<h3>Connection to EC2 instance</h3>
<p>Success! You should now have successfully connected to your EC2 instance via SSH.</p>
<h2 id="connecting-over-windows">Connecting over Windows</h2>
<p>If you&#8217;re using Windows and don&#8217;t have the <code>ssh</code> command available, you can use an SSH client like PuTTY:</p>
<ul>
<li>First, convert your private key file (.pem) to a format compatible with PuTTY (.ppk) using PuTTYgen. If you do not know how, just <a href="#generating_a_ppk_file_from_a_pem_file">check the section below</a>.</li>
<li>Open PuTTY and enter the public IPv4 DNS or IP address of your EC2 instance in the <i>&#8220;Host Name (or IP address)&#8221;</i> field. Keep <i>&#8220;Connection type&#8221;</i> as <i>&#8220;SSH&#8221;</i>.</li>
<li>From the <i>&#8220;Connection&#8221;</i> category in left tree navigation, select <i>&#8220;SSH -> Auth&#8221;</i> and click on <i>&#8220;Credentials&#8221;</i>.</li>
<li>For <i>&#8220;Private key file for authentication&#8221;</i> click on <i>&#8220;Browse&#8221;</i> and select the private key file (.ppk).</li>
<li>Click on <i>&#8220;Open&#8221;</i> to initiate the SSH connection. At <i>&#8220;Putty Security Alert&#8221;</i>, click <i>&#8220;Yes&#8221;</i> to accept the server&#8217;s host key.</li>
</ul>
<h3 id="generating_a_ppk_file_from_a_pem_file">Generating a .ppk file from a .pem file</h3>
<p>To convert your private key file (.pem) to a .ppk file for use with PuTTY, follow these steps:</p>
<ul>
<li>Open PuTTY Key Generator (PuTTYgen) and click on <i>&#8220;Load&#8221;</i> to select your private key file (.pem).</li>
<li>Click on <i>&#8220;Save private key&#8221;</i> to convert the key to PuTTY&#8217;s .ppk format and save it to a location of your choice.</li>
<li>You can now connect the converted .ppk file with PuTTY to your EC2 instance.</li>
</ul>
<h2>Conclusion</h2>
<p>This article has shown how to connect to an Amazon EC2 instance over SSH. Following the steps outlined above, you can securely access your EC2 instance and manage it remotely using SSH.</p>
<p>Be sure to store your private key file securely and avoid sharing it with others, as it serves as the gateway to accessing your Amazon EC2 instance.</p>
<p>If you face any connection issues, verify that your instance is operational, that your security group permits SSH access from your IP address, and that you employ the correct private key file.</p>
<p>Did you find connecting to your EC2 instance over SSH easy? Do you have tips or another way to connect to an EC2 instance? Let us know in the comments below. We&#8217;d love to hear your ideas and experiences.</p>
<p>Thanks for reading!</p>
<p>Like this article? Please share it with your friends and help us grow. Happy coding! 😊</p>
]]></content:encoded>
					
					<wfw:commentRss>https://codepills.com/how-to-connect-to-an-ec2-instance-over-ssh/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
