<?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>harden ubuntu 20.04 Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/harden-ubuntu-20-04/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Wed, 06 May 2020 15:53:21 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>Guide To Initial Server Setup on Ubuntu 20.04</title>
		<link>https://www.osradar.com/guide-to-initial-server-setup-on-ubuntu-20-04/</link>
					<comments>https://www.osradar.com/guide-to-initial-server-setup-on-ubuntu-20-04/#respond</comments>
		
		<dc:creator><![CDATA[sabi]]></dc:creator>
		<pubDate>Wed, 06 May 2020 14:43:14 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[focal]]></category>
		<category><![CDATA[Focal Fossa]]></category>
		<category><![CDATA[Guide To Initial Server Setup on Ubuntu 20.04]]></category>
		<category><![CDATA[harden ubuntu 20.04]]></category>
		<category><![CDATA[how to secure ubuntu 20.04]]></category>
		<category><![CDATA[Initial server setup ubuntu 20.04]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Ubuntu 20.04 tutorials]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=20060</guid>

					<description><![CDATA[<p>Today we are going to learn that how you can take initial steps to secure and harden your freshly installed Ubuntu 20.04 system in order to stay secure. Just follow the below guide to initial server setup on Ubuntu 20.04 to keep you away from attackers. Step 1: Upgrade Your System Make sure that you&#8217;ve [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/guide-to-initial-server-setup-on-ubuntu-20-04/">Guide To Initial Server Setup on Ubuntu 20.04</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Today we are going to learn that how you can take initial steps to secure and harden your freshly installed Ubuntu 20.04 system in order to stay secure. Just follow the below guide to <a href="https://www.osradar.com/?p=20060">initial server setup on Ubuntu 20.04 </a> to keep you away from attackers.</p>



<h3><strong>Step 1: Upgrade Your System</strong></h3>



<p>Make sure that you&#8217;ve the fresh updates and all packages are upgraded successfully. Run the below command to update and upgrade your Ubuntu 20.4.</p>



<pre class="wp-block-verse">sudo apt update &amp;&amp; sudo apt upgrade -y</pre>



<h3><strong>Step 2: Add User Account for Ubuntu 20.04</strong></h3>



<p>Make sure you&#8217;ve created a system user. Root user is not recommended for work on Ubuntu 20.04. Type the below command to add a user to the Server.</p>



<pre class="wp-block-verse">sudo adduser sysadmin</pre>



<p>Then add this user to the sudo group by hitting the following command to attain sudo privileges.</p>



<pre class="wp-block-verse">sudo usermod -aG sudo sysadmin</pre>



<h3><strong>Step 3: Enable Secure SSH Server</strong></h3>



<p>To enable secure SSH access, first of all change the default SSH port and also make sure to disable the remote root SSH login. Because default ports are open to attackers and they can easily try to get into your system. To do this edit the file <strong>/etc/ssh/ssh_config</strong> with your favorite editor.</p>



<pre class="wp-block-verse">Port 2222<br>PermitRootLogin no</pre>



<h3><strong>Step 4: Set Key Based SSH</strong> <strong>On Ubuntu 20.04</strong></h3>



<p>We recommend you to prefer the key-base SSH login instead of using a password. Run the below command to generate the SSH key on Ubuntu 20.4.</p>



<pre class="wp-block-verse">ssh-keygen</pre>



<pre class="wp-block-verse">sabi@Ubuntu:~$ ssh-keygen<br> Generating public/private rsa key pair.<br> Enter file in which to save the key (/home/sabi/.ssh/id_rsa): <br> Enter passphrase (empty for no passphrase): <br> Enter same passphrase again: <br> Your identification has been saved in /home/sabi/.ssh/id_rsa<br> Your public key has been saved in /home/sabi/.ssh/id_rsa.pub<br> The key fingerprint is:<br> SHA256:lcgQhanDckHCU3qX0PrFpFqcwqMC0l9qU+n1JCPwGLg sabi@Ubuntu<br> The key's randomart image is:<br> +---[RSA 3072]----+<br> | ..++.o=.        |<br> |  +o+.++.. .     |<br> | ..=.Xo*o o      |<br> |o E.@.@ *..      |<br> |o  = % +S=       |<br> |. . * o   .      |<br> | . . .           |<br> |                 |<br> |                 |<br> +----[SHA256]-----+</pre>



<p>Then copy the new public key .<strong>ssh/id_rsa.pub</strong> file data to server <strong>~/.ssh/authorized_keys </strong>file. For convenience, you can also run the following command.</p>



<pre class="wp-block-verse">ssh-copy-id -i ~/.ssh/id_rsa.pub sysadmin@remote.server.net</pre>



<p>And login without any password.</p>



<pre class="wp-block-verse">ssh sysadmin@remote.server.net</pre>



<h3><strong>Step 5: Configuring Firewall with FirewallD on Ubuntu 20.04</strong></h3>



<p>As firewalld is not installed on the Ubuntu 20.04 so install it by the following command.</p>



<pre class="wp-block-verse">sudo apt install firewalld</pre>



<p>Then start and enable the firewalld services to take effect.</p>



<pre class="wp-block-verse">systemctl start firewalld<br>systemctl enable firewalld</pre>



<p>As firewall only allow SSH access to remote users you may add other services as you needed. Here I&#8217;m going to add http and https the command will be like</p>



<pre class="wp-block-verse">firewall-cmd --permanent --add-service=http<br>firewall-cmd --permanent --add-service=https</pre>



<p><strong>Note:</strong> Firewall uses the <strong>/etc/services</strong> file to check the ports of the services. If some ports are not included in /etc/services, you can add like below.</p>



<pre class="wp-block-verse">firewall-cmd --permanent --add-port=8080/tcp<br>firewall-cmd --permanent --add-port=10000/tcp</pre>



<p>You can reload the changes by typing</p>



<pre class="wp-block-verse">firewall-cmd --reload</pre>



<p>To see a list of all the allowed services run</p>



<pre class="wp-block-verse">firewall-cmd --permanent --list-all</pre>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" width="724" height="575" src="//1723336065.rsc.cdn77.org/wp-content/uploads/2020/05/firewa.png" alt="" class="wp-image-20065" srcset="https://www.osradar.com/wp-content/uploads/2020/05/firewa.png 724w, https://www.osradar.com/wp-content/uploads/2020/05/firewa-300x238.png 300w, https://www.osradar.com/wp-content/uploads/2020/05/firewa-696x553.png 696w" sizes="(max-width: 724px) 100vw, 724px" /></figure></div>



<p>So, this is how you can take initial server setup to harden your system Ubuntu 20.04.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/guide-to-initial-server-setup-on-ubuntu-20-04/">Guide To Initial Server Setup on Ubuntu 20.04</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/guide-to-initial-server-setup-on-ubuntu-20-04/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
