<?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>Security, Upgrade, and Backup Archives - ServerStadium</title>
	<atom:link href="https://serverstadium.com/knowledge-base/category/security-upgrade-and-backup/feed/" rel="self" type="application/rss+xml" />
	<link>https://serverstadium.com/knowledge-base/category/security-upgrade-and-backup/</link>
	<description>Public Cloud Solution by ServerStadium</description>
	<lastBuildDate>Tue, 09 Dec 2025 06:15:10 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>

<image>
	<url>https://serverstadium.com/wp-content/uploads/2023/04/cropped-favicon-1-32x32.png</url>
	<title>Security, Upgrade, and Backup Archives - ServerStadium</title>
	<link>https://serverstadium.com/knowledge-base/category/security-upgrade-and-backup/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Configuring OpenVPN for Secure Remote Access on ServerStadium Dedicated Servers</title>
		<link>https://serverstadium.com/knowledge-base/configuring-openvpn-secure-remote-access-dedicated-servers/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Fri, 28 Mar 2025 00:30:29 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=12155</guid>

					<description><![CDATA[<p>Introduction This guide details how to configure OpenVPN for secure remote access on a ServerStadium dedicated server. OpenVPN is a robust and flexible VPN solution that provides encrypted connections for secure communication. Leveraging ServerStadium’s high-performance infrastructure, you can deploy a secure VPN environment to enable safe remote access to your network. Prerequisites Before you begin,&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/configuring-openvpn-secure-remote-access-dedicated-servers/">Configuring OpenVPN for Secure Remote Access on ServerStadium Dedicated Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Introduction</h2>



<p class="wp-block-paragraph">This guide details how to configure OpenVPN for secure remote access on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a>. OpenVPN is a robust and flexible VPN solution that provides encrypted connections for secure communication. Leveraging ServerStadium’s high-performance infrastructure, you can deploy a secure VPN environment to enable safe remote access to your network.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<p class="wp-block-paragraph">Before you begin, ensure you have the following:</p>



<ul class="wp-block-list">
  
  <li>A <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> running Ubuntu (or a similar Linux distribution).</li>
  
  
  <li>Basic command line knowledge and sudo privileges.</li>
  
  
  <li>Familiarity with network configuration and VPN concepts.</li>
  
</ul>



<h2 class="wp-block-heading">Deployment Steps</h2>



<h3 class="wp-block-heading">1. Update Your System</h3>



<p class="wp-block-paragraph">Begin by updating your system packages to ensure you have the latest security patches:</p>


<pre><code>sudo apt-get update && sudo apt-get upgrade -y</code></pre>


<h3 class="wp-block-heading">2. Install OpenVPN</h3>



<p class="wp-block-paragraph">Install OpenVPN and Easy-RSA using the package manager:</p>


<pre><code>sudo apt-get install openvpn easy-rsa -y</code></pre>


<h3 class="wp-block-heading">3. Configure the CA and Generate Certificates</h3>



<p class="wp-block-paragraph">Create a directory for Easy-RSA and set up the Public Key Infrastructure (PKI):</p>


<pre><code>make-cadir ~/openvpn-ca
cd ~/openvpn-ca
./easyrsa init-pki
./easyrsa build-ca nopass</code></pre>


<p class="wp-block-paragraph">Generate the server certificate and key, then generate Diffie-Hellman parameters:</p>


<pre><code>./easyrsa gen-req server nopass
./easyrsa sign-req server server
./easyrsa gen-dh</code></pre>


<h3 class="wp-block-heading">4. Configure the OpenVPN Server</h3>



<p class="wp-block-paragraph">Copy the sample configuration file to the OpenVPN directory:</p>


<pre><code>sudo cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz /etc/openvpn/
cd /etc/openvpn
sudo gunzip server.conf.gz</code></pre>


<p class="wp-block-paragraph">Edit the <code>server.conf</code> file to match your requirements. For example, set the certificate and key file paths:</p>


<pre><code>sudo nano /etc/openvpn/server.conf</code></pre>


<p class="wp-block-paragraph">Ensure the following lines are updated with your file paths:</p>


<pre><code>ca /etc/openvpn/ca.crt
cert /etc/openvpn/server.crt
key /etc/openvpn/server.key
dh /etc/openvpn/dh.pem</code></pre>


<p class="wp-block-paragraph">Copy your generated certificates and keys from the <code>~/openvpn-ca/pki</code> directory to <code>/etc/openvpn/</code>:</p>


<pre><code>sudo cp ~/openvpn-ca/pki/ca.crt /etc/openvpn/
sudo cp ~/openvpn-ca/pki/issued/server.crt /etc/openvpn/
sudo cp ~/openvpn-ca/pki/private/server.key /etc/openvpn/
sudo cp ~/openvpn-ca/pki/dh.pem /etc/openvpn/</code></pre>


<h3 class="wp-block-heading">5. Adjust Firewall and Enable IP Forwarding</h3>



<p class="wp-block-paragraph">Edit the sysctl configuration to enable IP forwarding:</p>


<pre><code>sudo nano /etc/sysctl.conf</code></pre>


<p class="wp-block-paragraph">Uncomment or add the following line:</p>


<pre><code>net.ipv4.ip_forward=1</code></pre>


<p class="wp-block-paragraph">Apply the changes:</p>


<pre><code>sudo sysctl -p</code></pre>


<p class="wp-block-paragraph">Adjust your firewall (UFW example) to allow OpenVPN traffic:</p>


<pre><code>sudo ufw allow 1194/udp</code></pre>


<h3 class="wp-block-heading">6. Start the OpenVPN Service</h3>



<p class="wp-block-paragraph">Start the OpenVPN server and enable it to run on boot:</p>


<pre><code>sudo systemctl start openvpn@server
sudo systemctl enable openvpn@server</code></pre>


<h2 class="wp-block-heading">Post-Deployment Configuration</h2>



<p class="wp-block-paragraph">After configuring OpenVPN, consider these enhancements:</p>


<ul class="wp-block-list">
  
  <li>Set up client configuration files to securely connect to your VPN.</li>
  
  
  <li>Implement additional firewall rules to restrict access.</li>
  
  
  <li>Monitor VPN logs to track connections and detect potential issues.</li>
  
</ul>
<!-- /wp:post-content -->

<!-- wp:paragraph {"className":""} -->
<p>Hosting your OpenVPN service on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> ensures a secure and high-performance environment for remote access, providing peace of mind for your organization.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"className":""} -->
<h2 class="wp-block-heading">Troubleshooting</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":""} -->
<p>If you encounter issues during installation or operation:</p>
<!-- /wp:paragraph -->

<ul class="wp-block-list">
  <!-- wp:list-item -->
  <li>Ensure all prerequisites are installed and your system is updated.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Review the OpenVPN log files located in <code>/var/log/openvpn/</code> for error messages.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Verify that your firewall and IP forwarding settings are correct.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Consult the OpenVPN documentation and our guides in the <a href="https://serverstadium.com/knowledge-base/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium Knowledge Base</a> for further assistance.</li>
  <!-- /wp:list-item -->
</ul>
<!-- /wp:list -->

<!-- wp:heading {"className":""} -->
<h2 class="wp-block-heading">Conclusion</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":""} -->
<p>Configuring OpenVPN for secure remote access on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> provides a reliable, secure solution for remote connectivity. By following this guide, you can establish a VPN that protects your network and ensures encrypted communication for all remote users. For more help or information about ServerStadium services, visit our <a href="https://serverstadium.com/knowledge-base/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">knowledge base</a> or the <a href="https://serverstadium.com/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium website</a>.</p>
<!-- /wp:paragraph -->
<p>The post <a href="https://serverstadium.com/knowledge-base/configuring-openvpn-secure-remote-access-dedicated-servers/">Configuring OpenVPN for Secure Remote Access on ServerStadium Dedicated Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Implementing Fail2Ban for Intrusion Prevention on ServerStadium Dedicated Servers</title>
		<link>https://serverstadium.com/knowledge-base/implementing-fail2ban-intrusion-prevention-dedicated-servers/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Thu, 27 Mar 2025 18:34:56 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=12151</guid>

					<description><![CDATA[<p>Introduction This guide explains how to implement Fail2Ban for intrusion prevention on a ServerStadium dedicated server. Fail2Ban is a powerful security tool that monitors log files for suspicious activity and automatically bans IPs that exhibit malicious behavior. With our high-performance dedicated servers, you can enhance your server security and protect against unauthorized access and brute-force&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/implementing-fail2ban-intrusion-prevention-dedicated-servers/">Implementing Fail2Ban for Intrusion Prevention on ServerStadium Dedicated Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Introduction</h2>



<p class="wp-block-paragraph">This guide explains how to implement Fail2Ban for intrusion prevention on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a>. Fail2Ban is a powerful security tool that monitors log files for suspicious activity and automatically bans IPs that exhibit malicious behavior. With our high-performance dedicated servers, you can enhance your server security and protect against unauthorized access and brute-force attacks.</p>



<h2 class="wp-block-heading">Prerequisites</h2>



<p class="wp-block-paragraph">Before you begin, ensure you have the following:</p>



<ul class="wp-block-list">
  
  <li>A <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> running Ubuntu or a similar Linux distribution.</li>
  
  
  <li>Basic command line knowledge and sudo privileges.</li>
  
  
  <li>An understanding of server logs and common intrusion patterns.</li>
  
</ul>



<h2 class="wp-block-heading">Deployment Steps</h2>



<h3 class="wp-block-heading">1. Update Your System</h3>



<p class="wp-block-paragraph">Begin by updating your system packages to ensure you have the latest security patches and software updates:</p>


<pre><code>sudo apt-get update && sudo apt-get upgrade -y</code></pre>


<h3 class="wp-block-heading">2. Install Fail2Ban</h3>



<p class="wp-block-paragraph">Install Fail2Ban using the package manager:</p>


<pre><code>sudo apt-get install fail2ban -y</code></pre>


<h3 class="wp-block-heading">3. Configure Fail2Ban</h3>



<p class="wp-block-paragraph">Create a local configuration file to override the default settings. Copy the sample configuration:</p>


<pre><code>sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local</code></pre>


<p class="wp-block-paragraph">Edit the local configuration file to adjust jail settings, such as ban time, find time, and max retry attempts:</p>


<pre><code>sudo nano /etc/fail2ban/jail.local</code></pre>


<p class="wp-block-paragraph">For example, to protect SSH, ensure the [sshd] section is enabled and customized as needed:</p>


<pre><code>[sshd]
enabled = true
port    = ssh
filter  = sshd
logpath = /var/log/auth.log
maxretry = 5</code></pre>


<h3 class="wp-block-heading">4. Start and Enable Fail2Ban</h3>



<p class="wp-block-paragraph">Start the Fail2Ban service and enable it to run at boot:</p>


<pre><code>sudo systemctl start fail2ban
sudo systemctl enable fail2ban</code></pre>


<h3 class="wp-block-heading">5. Verify Fail2Ban Operation</h3>



<p class="wp-block-paragraph">Check the status of Fail2Ban and review active jails with:</p>


<pre><code>sudo fail2ban-client status</code></pre>


<p class="wp-block-paragraph">You can also check the status of a specific jail (e.g., sshd) with:</p>


<pre><code>sudo fail2ban-client status sshd</code></pre>


<h2 class="wp-block-heading">Post-Deployment Configuration</h2>



<p class="wp-block-paragraph">After implementing Fail2Ban, consider the following enhancements:</p>


<ul class="wp-block-list">
  
  <li>Regularly review Fail2Ban logs to monitor banned IPs and adjust configurations as necessary.</li>
  
  
  <li>Add additional jails for other services (e.g., Apache, FTP) to further enhance security.</li>
  
  
  <li>Integrate email notifications or alerts for ban events to stay informed about potential threats.</li>
  
</ul>
<!-- /wp:post-content -->

<!-- wp:paragraph {"className":""} -->
<p>Hosting Fail2Ban on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> ensures that you benefit from a secure and high-performance environment, crucial for protecting your infrastructure from intrusions.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"className":""} -->
<h2 class="wp-block-heading">Troubleshooting</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":""} -->
<p>If you encounter issues during setup or operation:</p>
<!-- /wp:paragraph -->

<ul class="wp-block-list">
  <!-- wp:list-item -->
  <li>Ensure all prerequisites and dependencies are installed correctly.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Review the Fail2Ban logs in <code>/var/log/fail2ban.log</code> for error messages.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Check your jail configurations in <code>/etc/fail2ban/jail.local</code> for errors or misconfigurations.</li>
  <!-- /wp:list-item -->
  <!-- wp:list-item -->
  <li>Consult the Fail2Ban documentation and our guides in the <a href="https://serverstadium.com/knowledge-base/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium Knowledge Base</a> for further assistance.</li>
  <!-- /wp:list-item -->
</ul>
<!-- /wp:list -->

<!-- wp:heading {"className":""} -->
<h2 class="wp-block-heading">Conclusion</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"className":""} -->
<p>Implementing Fail2Ban for intrusion prevention on a <a href="https://serverstadium.com/dedicated-server/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium dedicated server</a> provides an effective layer of security to protect your infrastructure from unauthorized access and brute-force attacks. Leverage our high-performance hosting services to ensure your server remains secure and resilient. For more help or information about ServerStadium services, visit our <a href="https://serverstadium.com/knowledge-base/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">knowledge base</a> or the <a href="https://serverstadium.com/?utm_source=kb&#038;utm_medium=article&#038;utm_campaign=dedicated_server">ServerStadium website</a>.</p>
<!-- /wp:paragraph -->
<p>The post <a href="https://serverstadium.com/knowledge-base/implementing-fail2ban-intrusion-prevention-dedicated-servers/">Implementing Fail2Ban for Intrusion Prevention on ServerStadium Dedicated Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Database Optimization on ServerStadium Servers</title>
		<link>https://serverstadium.com/knowledge-base/database-optimization-on-serverstadium-servers/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Thu, 04 Jan 2024 04:16:18 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11787</guid>

					<description><![CDATA[<p>Introduction Optimizing database performance is key to maintaining fast and reliable data access, especially in high-demand environments. On ServerStadium servers, fine-tuning your database, whether it&#8217;s MySQL, PostgreSQL, or MongoDB, can lead to significantly improved performance. This guide offers tips and best practices for optimizing these popular database systems on ServerStadium&#8217;s infrastructure. Database Optimization on ServerStadium&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/database-optimization-on-serverstadium-servers/">Database Optimization on ServerStadium Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>Optimizing database performance is key to maintaining fast and reliable data access, especially in high-demand environments. On <a href="http://Https://ServerStadium">ServerStadium</a> servers, fine-tuning your database, whether it&#8217;s MySQL, PostgreSQL, or MongoDB, can lead to significantly improved performance. This guide offers tips and best practices for optimizing these popular database systems on ServerStadium&#8217;s infrastructure.</p>
<h2>Database Optimization on ServerStadium</h2>
<h3>Prerequisites</h3>
<ul>
<li>A ServerStadium VM or dedicated server (<a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">VM Pricing</a>, <a href="https://serverstadium.com/dedicated-server/" target="_new" rel="noopener">Dedicated Servers</a>).</li>
<li>Basic knowledge of Linux and command-line interface.</li>
</ul>
<h3>General Optimization Tips</h3>
<p>Before diving into specific databases, here are some general optimization strategies:</p>
<ol>
<li><strong>Regular Maintenance</strong>: Regularly update and maintain your database software to the latest stable version.</li>
<li><strong>Monitor Performance</strong>: Utilize monitoring tools to track database performance and identify bottlenecks.</li>
<li><strong>Backup and Disaster Recovery</strong>: Regularly backup your databases and have a disaster recovery plan in place.</li>
</ol>
<h3>Optimizing MySQL on ServerStadium</h3>
<ol>
<li><strong>Tune Key Parameters</strong>: Adjust key settings in <code>my.cnf</code> like <code>innodb_buffer_pool_size</code>, <code>max_connections</code>, and <code>query_cache_size</code> based on your server&#8217;s resources and workload.</li>
<li><strong>Indexing</strong>: Properly index your tables to speed up query execution.</li>
<li><strong>Use EXPLAIN</strong>: Regularly use the <code>EXPLAIN</code> statement to analyze and optimize your SQL queries.</li>
<li><strong>Partitioning</strong>: Consider partitioning large tables to improve performance and management.</li>
</ol>
<h3>Optimizing PostgreSQL on ServerStadium</h3>
<ol>
<li><strong>Configuration Tuning</strong>: In <code>postgresql.conf</code>, tune parameters like <code>shared_buffers</code>, <code>work_mem</code>, <code>maintenance_work_mem</code>, and <code>effective_cache_size</code>.</li>
<li><strong>Vacuum and Analyze</strong>: Regularly run the <code>VACUUM</code> and <code>ANALYZE</code> commands to maintain database health.</li>
<li><strong>Index Maintenance</strong>: Use appropriate indexing strategies (B-tree, hash, GIN, etc.) for your queries and regularly monitor their performance.</li>
<li><strong>Connection Pooling</strong>: Use connection pooling to manage a large number of client connections efficiently.</li>
</ol>
<h3>Optimizing MongoDB on ServerStadium</h3>
<ol>
<li><strong>Sharding</strong>: Implement sharding to distribute data across multiple machines.</li>
<li><strong>Indexing</strong>: Proper indexing is crucial in MongoDB for query performance. Regularly review and optimize your indexes.</li>
<li><strong>Replication</strong>: Set up replication for data redundancy and high availability.</li>
<li><strong>Resource Allocation</strong>: Ensure that MongoDB has sufficient RAM and is configured to effectively use the available memory.</li>
</ol>
<h3>Conclusion</h3>
<p>Optimizing your database on ServerStadium servers can lead to significant performance improvements. By following these tips and regularly monitoring your database, you can ensure efficient, fast, and reliable data access.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/database-optimization-on-serverstadium-servers/">Database Optimization on ServerStadium Servers</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Automating Tasks on Ubuntu with Cron Jobs: A Comprehensive Guide with ServerStadium</title>
		<link>https://serverstadium.com/knowledge-base/automating-tasks-with-cron-on-ubuntu/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Mon, 18 Sep 2023 19:45:50 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11736</guid>

					<description><![CDATA[<p>In the dynamic world of server management, efficiency is key. One of the most powerful tools at an administrator&#8217;s disposal is the ability to automate tasks. Enter cron jobs, a scheduler for Unix-like operating systems, including Ubuntu. With ServerStadium&#8217;s robust infrastructure, setting up and managing cron jobs becomes a breeze. What are Cron Jobs? Cron&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/automating-tasks-with-cron-on-ubuntu/">Automating Tasks on Ubuntu with Cron Jobs: A Comprehensive Guide with ServerStadium</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In the dynamic world of server management, efficiency is key. One of the most powerful tools at an administrator&#8217;s disposal is the ability to automate tasks. Enter cron jobs, a scheduler for Unix-like operating systems, including Ubuntu. With ServerStadium&#8217;s robust infrastructure, setting up and managing cron jobs becomes a breeze.</p>
<p><strong>What are Cron Jobs?</strong></p>
<p>Cron jobs are scheduled tasks that run automatically at specified intervals on your server. Whether it&#8217;s daily backups, regular system updates, or any repetitive tasks, cron jobs ensure your server operates smoothly without manual intervention.</p>
<p><strong>Setting Up Cron on Ubuntu with ServerStadium</strong></p>
<ol>
<li><strong>Installation</strong>: Most Ubuntu servers come with cron pre-installed. If not, install it with:
<div class="bg-black rounded-md mb-4">
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-sql">sudo apt<span class="hljs-operator">-</span><span class="hljs-keyword">get</span> <span class="hljs-keyword">update</span><br />
sudo apt<span class="hljs-operator">-</span><span class="hljs-keyword">get</span> install cron<br />
</code></div>
</div>
</li>
<li><strong>Configuration</strong>: Access the cron table to set up tasks:
<div class="bg-black rounded-md mb-4">
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs">crontab -e<br />
</code></div>
</div>
<p>This opens the user-specific cron table where you can add tasks.</li>
<li><strong>Scheduling Tasks</strong>: Cron uses a specific format to schedule tasks. For instance, to run a backup script daily at midnight, you&#8217;d add:
<div class="bg-black rounded-md mb-4">
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-javascript"><span class="hljs-number">0</span> <span class="hljs-number">0</span> * * * <span class="hljs-regexp">/path/</span>to/backup_script.<span class="hljs-property">sh</span><br />
</code></div>
</div>
<p>Familiarize yourself with the cron time format to schedule tasks as needed.</li>
</ol>
<p><strong>Best Practices for Cron Jobs on ServerStadium</strong></p>
<ol>
<li><strong>Logging</strong>: Ensure your cron jobs log outputs, especially errors. This helps in troubleshooting. For example:
<div class="bg-black rounded-md mb-4">
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-javascript"><span class="hljs-number">0</span> <span class="hljs-number">0</span> * * * <span class="hljs-regexp">/path/</span>to/script.<span class="hljs-property">sh</span> &gt;&gt; <span class="hljs-regexp">/path/</span>to/logfile.<span class="hljs-property">log</span> <span class="hljs-number">2</span>&gt;&amp;<span class="hljs-number">1</span><br />
</code></div>
</div>
</li>
<li><strong>Backup</strong>: Before making changes to the crontab, consider backing it up using:
<div class="bg-black rounded-md mb-4">
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs">crontab -l &gt; backup_crontab.txt </code></div>
</div>
</li>
<li><strong>Security</strong>: Ensure scripts called by cron jobs have appropriate permissions and are not accessible by unauthorized users.</li>
</ol>
<p><strong>Conclusion</strong> Cron jobs offer a world of automation possibilities, ensuring your server operations are efficient and timely. With <a href="https://serverstadium.com/dedicated-server/" target="_new" rel="noopener">ServerStadium&#8217;s dedicated servers</a> and <a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">cloud VM solutions</a>, you have the perfect environment to harness the power of cron on Ubuntu.</p>
<p>Looking for more insights and guides on server management? Dive into <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">ServerStadium&#8217;s knowledge base</a> for expert articles and tips.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/automating-tasks-with-cron-on-ubuntu/">Automating Tasks on Ubuntu with Cron Jobs: A Comprehensive Guide with ServerStadium</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Using Pre-Generated SSH Keys and Disabling Password Authentication for Secure Access to ServerStadium&#8217;s Cloud Instances</title>
		<link>https://serverstadium.com/knowledge-base/using-pre-generated-ssh-keys-and-disabling-password-authentication-for-secure-access-to-serverstadium-cloud-instances/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Fri, 26 May 2023 03:18:40 +0000</pubDate>
				<guid isPermaLink="false">https://serverstadium.com/?post_type=epkb_post_type_1&#038;p=11673</guid>

					<description><![CDATA[<p>Secure Shell (SSH) keys offer a more secure method of logging into a server than using a password alone. ServerStadium&#8217;s cloud instances are configured with pre-generated SSH keys for this purpose. This tutorial will guide you on using these SSH keys for secure access and disabling password authentication for your ServerStadium cloud instance. For more&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/using-pre-generated-ssh-keys-and-disabling-password-authentication-for-secure-access-to-serverstadium-cloud-instances/">Using Pre-Generated SSH Keys and Disabling Password Authentication for Secure Access to ServerStadium&#8217;s Cloud Instances</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Secure Shell (SSH) keys offer a more secure method of logging into a server than using a password alone. ServerStadium&#8217;s cloud instances are configured with pre-generated SSH keys for this purpose. This tutorial will guide you on using these SSH keys for secure access and disabling password authentication for your ServerStadium cloud instance.</p>
<p>For more tutorials and guides, make sure to visit our <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">Knowledge Base</a>.</p>
<h2>Step 1: Register Your Account</h2>
<p>If you haven&#8217;t already, you&#8217;ll need to create an account on our <a href="https://cp.serverstadium.com/regist-user" target="_new" rel="noopener">Registration Page</a>. Once registered, you&#8217;ll have access to your personal <a href="https://cp.serverstadium.com/" target="_new" rel="noopener">Cloud Dashboard</a>.</p>
<h2>Step 2: Add Your Cloud Instance</h2>
<p>From your <a href="https://cp.serverstadium.com/" target="_new" rel="noopener">Cloud Dashboard</a>, click the &#8216;Add VM&#8217; button. Choose a cloud instance that suits your needs and budget. For more detailed information about our offerings, you can visit our <a href="https://serverstadium.com/pricing/" target="_new" rel="noopener">Pricing Page</a>.</p>
<h2>Step 3: Retrieve Your SSH Key</h2>
<p>Once your cloud instance is created, you can retrieve the pre-generated SSH key from your <a href="https://cp.serverstadium.com/" target="_new" rel="noopener">Cloud Dashboard</a>. Save this key to a secure location on your local machine, typically in the <code>~/.ssh/</code> directory.</p>
<p>Remember to set the correct permissions for your SSH key file with the following command:</p>
<div class="bg-black rounded-md mb-4">
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash"><span class="hljs-built_in">chmod</span> 600 ~/.ssh/your_ssh_key<br />
</code></div>
</div>
<p>Replace &#8220;your_ssh_key&#8221; with the filename of your SSH key.</p>
<h2>Step 4: Disable Password Authentication</h2>
<p>To enhance security, you can disable password authentication and allow only SSH key authentication. Log into your ServerStadium cloud instance and edit the SSH configuration file:</p>
<div class="bg-black rounded-md mb-4">
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">sudo nano /etc/ssh/sshd_config<br />
</code></div>
</div>
<p>Find the line that says <code>PasswordAuthentication</code> and change it to <code>no</code>. If the line is commented out, remove the <code>#</code> at the start of the line. Save and exit the file.</p>
<p>After making this change, you must restart the SSH service for the changes to take effect:</p>
<div class="bg-black rounded-md mb-4">
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">sudo systemctl restart ssh<br />
</code></div>
</div>
<h2>Step 5: Login Using SSH Keys</h2>
<p>Finally, log into your ServerStadium cloud instance using the SSH key with the following command:</p>
<div class="bg-black rounded-md mb-4">
<div class="p-4 overflow-y-auto"><code class="!whitespace-pre hljs language-bash">ssh -i ~/.ssh/your_ssh_key your_username@your_server_IP_address<br />
</code></div>
</div>
<p>Replace &#8220;your_ssh_key&#8221; with your SSH key filename, &#8220;your_username&#8221; with your actual username, and &#8220;your_server_IP_address&#8221; with the IP address of your ServerStadium cloud instance.</p>
<h2>Conclusion</h2>
<p>Congratulations! You&#8217;ve successfully used pre-generated SSH keys for secure access and disabled password authentication on your ServerStadium cloud instance. Now, you can log into your instance securely without needing a password.</p>
<p>Visit our <a href="https://serverstadium.com/knowledge-base/" target="_new" rel="noopener">Knowledge Base</a> for more tutorials and guides.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/using-pre-generated-ssh-keys-and-disabling-password-authentication-for-secure-access-to-serverstadium-cloud-instances/">Using Pre-Generated SSH Keys and Disabling Password Authentication for Secure Access to ServerStadium&#8217;s Cloud Instances</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Backup &#038; Sync Local and Remote Directories Using RSYNC</title>
		<link>https://serverstadium.com/knowledge-base/backup-sync-local-and-remote-directories-using-rsync-2/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Tue, 31 Jan 2023 03:56:59 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=3078</guid>

					<description><![CDATA[<p>There are many backup methods available on ServerStadiums’s Knowledge Base. In this tutorial, we will bring another backup &#38; synchronization topic. Here, we will learn how to synchronize directories and certain files from our main VM to another. Similar to deploying DRC from our main VM.  The method we will bring in this tutorial is&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/backup-sync-local-and-remote-directories-using-rsync-2/">Backup &#038; Sync Local and Remote Directories Using RSYNC</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">There are many backup methods available on ServerStadiums’s Knowledge Base. In this tutorial, we will bring another backup &amp; synchronization topic. Here, we will learn how to synchronize directories and certain files from our main VM to another. Similar to deploying DRC from our main VM. </p>



<div class="wp-block-spacer" style="height: 20px;" aria-hidden="true"> </div>



<p class="wp-block-paragraph">The method we will bring in this tutorial is by using RSYNC. What is RSYNC, the command line, and the example of its application? Let’s find out. </p>



<div class="wp-block-spacer" style="height: 30px;" aria-hidden="true"> </div>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>What is RSYNC?</strong></h2>



<div class="wp-block-spacer" style="height: 11px;" aria-hidden="true"> </div>



<p class="wp-block-paragraph">RSYNC is one of the powerful synchronization tools but quite easy to use. RSYNC runs on devices with Linux Based OS (Ubuntu, CentOS, Debian, etc.). </p>



<p class="wp-block-paragraph">&nbsp;</p>



<p class="wp-block-paragraph">By using RSYNC, we can synchronize any file or folder from one device (source) to one or more other devices (destination). </p>



<p class="wp-block-paragraph">&nbsp;</p>



<p class="wp-block-paragraph">The file transfer method on RSYNC can be through an SSH (secure shell) or RSH (remote shell) connection. Or even directly via the RSYNC daemon, so there will be an open RSYNC port on our device that will talk directly to an RSYNC client on another host.</p>



<p class="wp-block-paragraph">&nbsp;</p>



<p class="wp-block-paragraph">However, this tutorial will discuss how to use RSYNC from SSH connection; it will be more secure and, most importantly, encrypted. </p>



<p class="wp-block-paragraph">One of the capabilities of RSYNC is to synchronize which files differ between source and destination. (incremental backup). With this, we don&#8217;t need to copy files fully in every synchronization process. This can save more bandwidth and your network, especially if you want to synchronize 1 device and another over the public network.</p>



<p class="wp-block-paragraph">&nbsp;</p>



<p class="wp-block-paragraph">With RSYNC, we can also synchronize files and folders across OS, as long as they are still in one Linux distribution.</p>



<div class="wp-block-spacer" style="height: 30px;" aria-hidden="true"> </div>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>RSYNC Command Format</strong></h2>



<div class="wp-block-spacer" style="height: 11px;" aria-hidden="true"> </div>



<p class="wp-block-paragraph">Here is the command structure for RSYNC usage:  </p>



<div class="wp-block-spacer" style="height: 12px;" aria-hidden="true"> </div>



<figure class="wp-block-table is-style-regular" style="font-size: 15px;">
<table class="has-black-color has-very-light-gray-to-cyan-bluish-gray-gradient-background has-text-color has-background has-fixed-layout">
<tbody>
<tr>
<td><strong>rsync [optional modifiers] [source folder location] [destination folder location]</strong></td>
</tr>
</tbody>
</table>
</figure>


<hr class="wp-block-separator has-text-color has-vivid-cyan-blue-color has-alpha-channel-opacity has-vivid-cyan-blue-background-color has-background is-style-dots" />


<p class="wp-block-paragraph">There are optional modifiers that function to determine the action of our command. A group of main options from RSYNC includes:</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 33.33%;">
<p class="wp-block-paragraph"><strong>▶️ -r </strong></p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 66.66%;">
<p class="wp-block-paragraph">Recursive. Include directories and subdirectories as well as any files contained within the subdirectories. </p>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 33.33%;">
<p class="wp-block-paragraph"><strong>▶️ -a</strong></p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 66.66%;">
<p class="wp-block-paragraph">Archive. The complete version from <strong>–r, </strong>where <strong>–a</strong> is an alias from the group of options: <strong>-rlptgoD</strong></p>



<p class="wp-block-paragraph">Include the recursion option, preserves authorizations, file modification date/time, and the group as well as user ownership.</p>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 33.33%;">
<p class="wp-block-paragraph"><strong>▶️ -v</strong></p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 66.66%;">
<p class="wp-block-paragraph">Verbose. Displays a list of files that were copied during the sync process. </p>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 33.33%;">
<p class="wp-block-paragraph"><strong>▶️ &#8211;delete</strong></p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 66.66%;">
<p class="wp-block-paragraph">Delete, if the destination directory includes a folder or file which is missing from the source directory, delete it (can be done vice versa). </p>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 33.33%;">
<p class="wp-block-paragraph"><strong>▶️ -z</strong></p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 66.66%;">
<p class="wp-block-paragraph">Compress the files that we will synchronize so that the file size can be much smaller. RSYNC is smart enough to determine which file types need to be compressed or not</p>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 33.33%;">
<p class="wp-block-paragraph"><strong>▶️ &#8211;exclude</strong></p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 66.66%;">
<p class="wp-block-paragraph">Specify which file or folder patterns we want to exclude from the sync process. </p>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 33.33%;">
<p class="wp-block-paragraph"><strong><strong>▶️ &#8211;include</strong></strong></p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 66.66%;">
<p class="wp-block-paragraph">The opposite of the &#8211;exclude option, it defines a pattern of file or directory names to include in the sync process. Usually, users combine the “option include” with the “option exclude”. </p>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 33.33%;">
<p class="wp-block-paragraph"><strong>▶️ &#8211;dry-run</strong></p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 66.66%;">
<p class="wp-block-paragraph">Only shows what process your command will do without actually doing it.</p>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 33.33%;">
<p class="wp-block-paragraph"><strong>▶️ &#8211;progress</strong></p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 66.66%;">
<p class="wp-block-paragraph">It displays the Kb transferred and the Kb/s transfer rate. </p>



<p class="wp-block-paragraph">&nbsp;</p>
</div>
</div>



<p class="wp-block-paragraph">Those are some of the common RSYNC options that we can use. We can choose based on our needs and goals. But, in my personal opinion, what is essential to our need is -a -v and &#8211;progress so that the files and folders that are synchronized are exactly the same as the source destination; we can check which files will be processed and also see the transfer rate.</p>



<div class="wp-block-spacer" style="height: 30px;" aria-hidden="true"> </div>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Installing RSYNC</strong></h2>



<div class="wp-block-spacer" style="height: 11px;" aria-hidden="true"> </div>



<p class="wp-block-paragraph">RSYNC is generally installed as a default feature on devices with Linux-based OS. However, it is possible that your device doesn&#8217;t have it yet. </p>



<p class="wp-block-paragraph">If so, you can install RSYNC by running this command: </p>



<div class="wp-block-spacer" style="height: 12px;" aria-hidden="true"> </div>



<figure class="wp-block-table is-style-regular">
<table class="has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background">
<tbody>
<tr>
<td><strong>apt-get install rsync</strong></td>
</tr>
</tbody>
</table>
</figure>



<div class="wp-block-spacer" style="height: 12px;" aria-hidden="true"> </div>



<p class="wp-block-paragraph">In this tutorial, we are going to use 2 VMs from ServerStadium with Ubuntu as the OS. Don’t worry for those who use other Linux distributions; the operational method will be similar. If there’s a minor difference, it would be just on the RSYNC installation process.</p>



<p class="wp-block-paragraph">Both of the VMs will be in 2 different regions, Jakarta and Surabaya, to get a better experience of the real DRC conditions. </p>



<div class="wp-block-spacer" style="height: 30px;" aria-hidden="true"> </div>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Implementation</strong></h2>



<div class="wp-block-spacer" style="height: 11px;" aria-hidden="true"> </div>



<p class="wp-block-paragraph">After we discover the command format and how to install RSYNC, let’s work try it and make a sample test.</p>



<div class="wp-block-spacer" style="height: 9px;" aria-hidden="true"> </div>



<h5 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">▶️ Performing Local Backups</h5>



<div class="wp-block-spacer" style="height: 12px;" aria-hidden="true"> </div>



<p class="wp-block-paragraph">As the first test, let’s try to synchronize one directory with another, but still in the same VM. </p>



<div class="wp-block-spacer" style="height: 12px;" aria-hidden="true"> </div>



<figure class="wp-block-table">
<table class="has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background">
<tbody>
<tr>
<td><strong>Local Host</strong> <strong>&#8211; Source Dir</strong><br />➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖<br /><br /><strong>Files and folder list:</strong><br /><img fetchpriority="high" decoding="async" width="700" height="468" class="wp-image-3067" style="width: 700px;" src="https://serverstadium.com/wp-content/uploads/2023/01/file-list-z-src-2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2023/01/file-list-z-src-2.png 568w, https://serverstadium.com/wp-content/uploads/2023/01/file-list-z-src-2-300x201.png 300w" sizes="(max-width: 700px) 100vw, 700px" /><br /><br /><strong>RSYNC SYNTAX</strong><br /><strong>root@local-host:/usr/trial#</strong> <mark class="has-inline-color" style="background-color: rgba(0, 0, 0, 0); color: #5693e3;">rsync -avp source-dir<strong><code>/</code></strong> destination-dir</mark><br /><mark class="has-inline-color" style="background-color: rgba(0, 0, 0, 0); color: #ff0000;"><code>sending incremental file list<br />./<br />file1.txt<br />file2.txt<br />file3.txt<br />file4.txt<br />file5.txt<br />new/<br />new/testing-file.txt<br />presentation/<br />presentation/CR-SalesDeck.pdf<br />presentation/CR-presentation.pptx<br />subfolder/<br />subfolder/file10.txt<br />subfolder/file6.txt<br />subfolder/file7.txt<br />subfolder/file8.txt<br />subfolder/file9.txt<br />sent 5,891,441 bytes received 290 bytes 3,927,820.67 bytes/sec<br />total size is 5,888,936 speedup is 1.00</code></mark></td>
</tr>
</tbody>
</table>
</figure>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained">
<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-vertically-aligned-top is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<figure class="wp-block-table">
<table class="has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background has-fixed-layout">
<tbody>
<tr>
<td><strong><strong>Local Host</strong> <strong>&#8211; Destination Dir</strong></strong><br /><strong>➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖</strong><br /><br /><strong>Files and folder list:</strong><br /><img decoding="async" width="700" height="487" class="wp-image-3066" style="width: 700px;" src="https://serverstadium.com/wp-content/uploads/2023/01/file-list-x-dst.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2023/01/file-list-x-dst.png 523w, https://serverstadium.com/wp-content/uploads/2023/01/file-list-x-dst-300x209.png 300w" sizes="(max-width: 700px) 100vw, 700px" /></td>
</tr>
</tbody>
</table>
</figure>
</div>
</div>
</div>
</div>
</div></div>



<p class="wp-block-paragraph">↳ We can use the command above to synchronize all files and subfolders from the source destination. In this tutorial, I will use additional options <strong>-v</strong>, <strong>-p</strong> to check what files will be synchronized, and how’s the progress going. </p>



<div class="wp-block-spacer" style="height: 12px;" aria-hidden="true"> </div>



<p class="wp-block-paragraph">You may notice that there is a trailing slash <strong>(/)</strong> at the end of the first argument in the syntax, that this <strong>(/)</strong> specifies the contents of source dir. </p>



<p class="wp-block-paragraph">&nbsp;</p>



<p class="wp-block-paragraph">Without the trailing slash, <code>source dir, including the directory</code>, would be placed within the <code>destination dir</code>. The outcome would create a hierarchy like the following:</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-vertically-aligned-bottom is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<figure class="wp-block-table">
<table class="has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background has-fixed-layout">
<tbody>
<tr>
<td><strong><strong>Local Host</strong> <strong>&#8211; Destination Dir</strong></strong><br /><strong>➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖</strong><br /><br /><strong>Files and folder list:</strong><br /><img decoding="async" class="wp-image-3069" style="width: 700px;" src="https://serverstadium.com/wp-content/uploads/2023/01/file-list-w-dst-1.png" alt="" /></td>
</tr>
</tbody>
</table>
</figure>
</div>
</div>
</div>
</div>


<hr class="wp-block-separator has-text-color has-vivid-cyan-blue-color has-alpha-channel-opacity has-vivid-cyan-blue-background-color has-background is-style-dots" />


<p class="wp-block-paragraph">You can adjust it based on your project’s needs and goals. </p>



<div class="wp-block-spacer" style="height: 9px;" aria-hidden="true"> </div>



<h5 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">▶️ Performing Backup to Remote System</h5>



<div class="wp-block-spacer" style="height: 12px;" aria-hidden="true"> </div>



<p class="wp-block-paragraph">Now we can jump to one of the main capabilities of RSYNC, which is doing a backup and synchronization within the local devices towards our other devices (remote system). </p>



<p class="wp-block-paragraph">&nbsp;</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<figure class="wp-block-table">
<table class="has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background has-fixed-layout">
<tbody>
<tr>
<td><strong>Local Host</strong><br />➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖<br /><br /><strong>Files and folder list:</strong><br /><img decoding="async" width="700" height="468" class="wp-image-3064" style="width: 700px;" src="https://serverstadium.com/wp-content/uploads/2023/01/file-list-z-src.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2023/01/file-list-z-src.png 568w, https://serverstadium.com/wp-content/uploads/2023/01/file-list-z-src-300x201.png 300w" sizes="(max-width: 700px) 100vw, 700px" /><br /><br /><strong>RSYNC SYNTAX</strong><br /><strong>root@local-host:/usr/trial#</strong> <mark class="has-inline-color" style="background-color: rgba(0, 0, 0, 0); color: #5693e3;">rsync -avp source-dir/ root@remote-host:/usr/trial/destination-dir</mark><br /><mark class="has-inline-color" style="background-color: rgba(0, 0, 0, 0); color: #ff0000;"><code>sending incremental file list<br />./<br />file1.txt<br />file2.txt<br />file3.txt<br />file4.txt<br />file5.txt<br />new/<br />new/testing-file.txt<br />presentation/<br />presentation/CR-SalesDeck.pdf<br />presentation/CR-presentation.pptx<br />subfolder/<br />subfolder/file10.txt<br />subfolder/file6.txt<br />subfolder/file7.txt<br />subfolder/file8.txt<br />subfolder/file9.txt<br />sent 5,891,441 bytes received 290 bytes 3,927,820.67 bytes/sec<br />total size is 5,888,936 speedup is 1.00</code></mark></td>
</tr>
</tbody>
</table>
</figure>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<figure class="wp-block-table">
<table class="has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background has-fixed-layout">
<tbody>
<tr>
<td><strong>Remote Host</strong><br /><strong>➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖</strong><br /><br /><strong>Files and folder list:</strong><br /><img decoding="async" width="700" height="487" class="wp-image-3066" style="width: 700px;" src="https://serverstadium.com/wp-content/uploads/2023/01/file-list-x-dst.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2023/01/file-list-x-dst.png 523w, https://serverstadium.com/wp-content/uploads/2023/01/file-list-x-dst-300x209.png 300w" sizes="(max-width: 700px) 100vw, 700px" /></td>
</tr>
</tbody>
</table>
</figure>
</div>
</div>
</div>
</div>



<p class="wp-block-paragraph">↳ To sync with a remote system using RSYNC, you need SSH access configured between your local and remote machines and RSYNC installed on both systems. After you have the SSH access verified between the two machines, you can sync the source-dir folder to a destination-dir folder that is on the remote machine.</p>


<hr class="wp-block-separator has-text-color has-vivid-cyan-blue-color has-alpha-channel-opacity has-vivid-cyan-blue-background-color has-background is-style-dots" />


<p class="wp-block-paragraph">To avoid entering passwords repeatedly while the SSH access between the local and remote is processing, you can configure the SSH key within the two devices.  </p>



<p class="wp-block-paragraph">For those of you who may not know how to connect 2 systems using the ssh key, we will discuss it in a different article.  </p>


<hr class="wp-block-separator has-text-color has-vivid-cyan-blue-color has-alpha-channel-opacity has-vivid-cyan-blue-background-color has-background is-style-dots" />


<p class="wp-block-paragraph">Besides synchronizing the local device to the remote device, we can also do the reverse activity by synchronizing the remote device with our local device. For the syntax, we can simply reverse it.  </p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<figure class="wp-block-table">
<table class="has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background has-fixed-layout">
<tbody>
<tr>
<td><strong>root@local-host:/usr/trial#</strong> <mark class="has-inline-color" style="background-color: rgba(0, 0, 0, 0); color: #5693e3;">rsync -avp root@remote-host:/usr/trial/source-dir/ destination-dir/</mark></td>
</tr>
</tbody>
</table>
</figure>
</div>
</div>



<div class="wp-block-spacer" style="height: 9px;" aria-hidden="true"> </div>



<h5 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">▶️ Using Exclude Options</h5>



<p class="wp-block-paragraph">RSYNC also has the ability to filter which files or folders we want to exclude in the synchronization process. Yes, we can use the <strong>&#8211;exclude </strong>option. </p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<figure class="wp-block-table">
<table class="has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background has-fixed-layout">
<tbody>
<tr>
<td><strong>Local Host</strong><br />➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖<br /><br /><strong>Files and folder list:</strong><br /><img decoding="async" class="wp-image-3065" style="width: 700px;" src="https://serverstadium.com/wp-content/uploads/2023/01/file-list-z-src-1.png" alt="" /><br /><br /><strong>RSYNC SYNTAX</strong><br /><strong>root@local-host:/usr/trial#</strong> <mark class="has-inline-color" style="background-color: rgba(0, 0, 0, 0); color: #5693e3;">rsync -avp </mark><mark class="has-inline-color has-luminous-vivid-amber-color" style="background-color: rgba(0, 0, 0, 0);">&#8211;exclude=*.txt</mark><mark class="has-inline-color" style="background-color: rgba(0, 0, 0, 0); color: #5693e3;"> source-dir/ root@remote-host:/usr/trial/destination-dir</mark><br /><mark class="has-inline-color" style="background-color: rgba(0, 0, 0, 0); color: #ff0000;"><code>sending incremental file list<br />./<br />new/<br />presentation/<br />presentation/CR-SalesDeck.pdf<br />presentation/CR-presentation.pptx<br />subfolder/<br />sent 5,890,649 bytes received 73 bytes 2,356,288.80 bytes/sec<br />total size is 5,888,896 speedup is 1.00</code></mark></td>
</tr>
</tbody>
</table>
</figure>
</div>
</div>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<figure class="wp-block-table">
<table class="has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background has-fixed-layout">
<tbody>
<tr>
<td><strong>Remote Host</strong><br /><strong>➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖</strong><br /><br /><strong>Files and folder list:</strong><br /><img loading="lazy" decoding="async" width="700" height="457" class="wp-image-3063" style="width: 700px;" src="https://serverstadium.com/wp-content/uploads/2023/01/file-list-y-dst.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2023/01/file-list-y-dst.png 352w, https://serverstadium.com/wp-content/uploads/2023/01/file-list-y-dst-300x196.png 300w" sizes="(max-width: 700px) 100vw, 700px" /></td>
</tr>
</tbody>
</table>
</figure>
</div>
</div>
</div>
</div>



<p class="wp-block-paragraph">↳ So, in the sample, we will exclude the type file .<strong>txt </strong>from the synchronization process.</p>


<hr class="wp-block-separator has-alpha-channel-opacity is-style-dots" />


<p class="wp-block-paragraph">If you want to add another exclude condition, You can use the following array:  </p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<figure class="wp-block-table">
<table class="has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background has-fixed-layout">
<tbody>
<tr>
<td><strong>root@local-host:/usr/trial#</strong> <mark class="has-inline-color" style="background-color: rgba(0, 0, 0, 0); color: #5693e3;">rsync -avp </mark><mark class="has-inline-color has-luminous-vivid-orange-color" style="background-color: rgba(0, 0, 0, 0);">&#8211;exclude={&#8220;*.txt<em>&#8220;,&#8221;</em>*.jpg&#8221;,&#8221;/presentation&#8221;,&#8221;/new/*&#8221;}</mark><mark class="has-inline-color" style="background-color: rgba(0, 0, 0, 0); color: #5693e3;"> source-dir/ root@remote-host:/usr/trial/destination-dir</mark></td>
</tr>
</tbody>
</table>
</figure>
</div>
</div>
</div>
</div>



<p class="wp-block-paragraph">↳ So, in the above sample, we will exclude the type file<strong> .txt</strong>, <strong>.jpg</strong>, folder <strong>presentation</strong>, and what’s inside the <strong>new </strong>folder from the synchronization process.  </p>



<div class="wp-block-spacer" style="height: 9px;" aria-hidden="true"> </div>



<h5 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">▶️ Using Exclude &amp; Include Options</h5>



<p class="has-text-align-left wp-block-paragraph">Besides exclude, we are also able to filter with 2 direct conditions in the synchronization, include certain condition, and exclude other condition. We can also combine argument <strong>&#8211;exclude</strong> and <strong>&#8211;include</strong> into 1 command. </p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<figure class="wp-block-table">
<table class="has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background has-fixed-layout">
<tbody>
<tr>
<td><strong><strong>Local Host</strong><br /></strong>➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖<br /><br /><strong>Files and folder list:<br /></strong><img decoding="async" class="wp-image-3058" style="width: 700px;" src="https://serverstadium.com/wp-content/uploads/2023/01/file-list-z-1.png" alt="" /><br /><br /><strong>RSYNC SYNTAX</strong><br /><strong>root@local-host:/usr/trial#</strong> <mark class="has-inline-color" style="background-color: rgba(0, 0, 0, 0); color: #5693e3;">rsync -avp </mark><mark class="has-inline-color has-luminous-vivid-orange-color" style="background-color: rgba(0, 0, 0, 0);">&#8211;include=testing-file.txt &#8211;exclude={&#8220;*.txt<em>&#8220;,&#8221;</em>*.jpg&#8221;,&#8221;/presentation/<em>&#8220;,&#8221;</em>/new/*&#8221;}</mark><mark class="has-inline-color" style="background-color: rgba(0, 0, 0, 0); color: #5693e3;"> source-dir/ root@remote-host:/usr/trial/destination-dir</mark><br /><code><mark class="has-inline-color" style="background-color: rgba(0, 0, 0, 0); color: #ff0000;">sending incremental file list<br />./<br />new/<br />new/testing-file.txt<br />sent 203 bytes received 47 bytes 166.67 bytes/sec<br />total size is 0 speedup is 0.00</mark></code></td>
</tr>
</tbody>
</table>
</figure>
</div>
</div>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<figure class="wp-block-table">
<table class="has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background has-fixed-layout">
<tbody>
<tr>
<td><strong>Remote Host</strong><br /><strong>➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖➖</strong><br /><br /><strong>Files and folder list:</strong><br /><img loading="lazy" decoding="async" width="700" height="515" class="wp-image-3061" style="width: 700px;" src="https://serverstadium.com/wp-content/uploads/2023/01/file-list-z-dst.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2023/01/file-list-z-dst.png 397w, https://serverstadium.com/wp-content/uploads/2023/01/file-list-z-dst-300x221.png 300w" sizes="(max-width: 700px) 100vw, 700px" /></td>
</tr>
</tbody>
</table>
</figure>
</div>
</div>



<p class="wp-block-paragraph">If we see the output, the <strong>testing-file.txt </strong>is still synchronized even though they include in the condition of exclude <strong>*.txt </strong>dan <strong>/new/*</strong>. The subfolder is still synchronized even though what’s inside is not synchronized because it’s containing .<strong>txt </strong>file. </p>



<p class="wp-block-paragraph">So, to use this option, make sure you put the condition you want to run first. Then, other conditions will be put behind it. (Include some, exclude the rest) </p>



<p class="wp-block-paragraph">&nbsp;</p>



<div class="wp-block-spacer" style="height: 9px;" aria-hidden="true"> </div>



<h5 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">▶️ Multiple Destinations Synchronization</h5>



<p class="wp-block-paragraph">Because the natural method of RSYNC is to work on point-to-point synchronization, so there is no default command from RSYNC to conduct multiple destination synchronization.  </p>



<p class="wp-block-paragraph">However, we can do it with manual techniques. One of the ways to do it is by using the help from the command ‘for’ loop.  </p>



<p class="wp-block-paragraph">This is how to write Syntax Structure ‘for’ loop in providing RSYNC multiple destinations: </p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<figure class="wp-block-table">
<table class="has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background has-fixed-layout">
<tbody>
<tr>
<td><strong><mark class="has-inline-color has-black-color" style="background-color: rgba(0, 0, 0, 0);">$</mark><mark class="has-inline-color has-luminous-vivid-orange-color" style="background-color: rgba(0, 0, 0, 0);"> for dst in</mark> [destination folder location 1] [destination folder location 2] [destination folder location ..]<br />&gt; <mark class="has-inline-color has-luminous-vivid-orange-color" style="background-color: rgba(0, 0, 0, 0);">do </mark><mark class="has-inline-color has-black-color" style="background-color: rgba(0, 0, 0, 0);">rsync </mark>[optional modifiers] [source folder location] <mark class="has-inline-color has-luminous-vivid-orange-color" style="background-color: rgba(0, 0, 0, 0);">$dst</mark></strong><br /><strong>&gt;</strong> <strong><mark class="has-inline-color has-luminous-vivid-orange-color" style="background-color: rgba(0, 0, 0, 0);">done</mark></strong></td>
</tr>
</tbody>
</table>
</figure>
</div>
</div>



<p class="wp-block-paragraph">And for the sample implementation can be done as follows: </p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis: 100%;">
<figure class="wp-block-table">
<table class="has-very-light-gray-to-cyan-bluish-gray-gradient-background has-background has-fixed-layout">
<tbody>
<tr>
<td><strong>root@local-host:/usr/trial#</strong> <mark class="has-inline-color has-luminous-vivid-orange-color" style="background-color: rgba(0, 0, 0, 0);">for dst in</mark> <mark class="has-inline-color" style="background-color: rgba(0, 0, 0, 0); color: #5693e3;">root@remote-host-1:/usr/trial/destination-dir root@remote-host-2:/usr/trial/destination-dir</mark><br /><mark class="has-inline-color has-luminous-vivid-orange-color" style="background-color: rgba(0, 0, 0, 0);">do</mark> <mark class="has-inline-color" style="background-color: rgba(0, 0, 0, 0); color: #5693e3;">rsync -avp source-dir/</mark> <mark class="has-inline-color has-luminous-vivid-orange-color" style="background-color: rgba(0, 0, 0, 0);">$dst</mark><br /><mark class="has-inline-color has-luminous-vivid-orange-color" style="background-color: rgba(0, 0, 0, 0);">done</mark></td>
</tr>
</tbody>
</table>
</figure>
</div>
</div>
</div>
</div>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Common RSYNC Usage in Real-Life Conditions</strong></h2>



<div class="wp-block-spacer" style="height: 11px;" aria-hidden="true"> </div>



<p class="wp-block-paragraph">The RSYNC usage in the real-life conditions are unlimited; it includes these activities:  </p>



<ul class="wp-block-list">
<li>Backup and DRC for the website/web application asset </li>



<li>Backup to disk or usb stick</li>



<li>Full server migration from 1 VM to another VM. Yes, it is a great potential from RSYNC that is very possible to implement. For those who need help with this migration level, our support team can help you from our Manage Service. Feel free to schedule a consultation with us. </li>



<li>And many others. You can determine the conditions yourself for activities related to synchronization and backup on Linux-based OS.</li>
</ul>



<div class="wp-block-spacer" style="height: 30px;" aria-hidden="true"> </div>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Conclusion</strong></h2>



<p class="wp-block-paragraph">Now we know how to backup and synchronize local &amp; remote directories with RSYNC along with RSYNC’s benefits and usage. Hopefully, you find this article helpful.  </p>



<p class="has-text-align-left wp-block-paragraph">In my next article, I will continue this series of articles which discusses the other synchronization methods of 2 VMs. My tutorial&#8217;s final goal will be automatically synchronizing our main VM with our backup VM. Also, we will be discussing dividing our 2 VMs work loads equally. So, if any problem happens to one of our VM, the traffic will be distributed automatically to our backup VM. With that, our application will always be online seamlessly.</p>



<p class="wp-block-paragraph">Visit our <strong><a href="https://ServerStadium.com/knowledge-base/" target="_blank" rel="noreferrer noopener">knowledge base</a></strong> page for more tutorial articles. Or, if you don&#8217;t have ServerStadium Cloud VM, You can join us for free by registering yourself <strong><a href="https://cp.serverstadium.com/" target="_blank" rel="noreferrer noopener">here.</a></strong></p>
<p>The post <a href="https://serverstadium.com/knowledge-base/backup-sync-local-and-remote-directories-using-rsync-2/">Backup &#038; Sync Local and Remote Directories Using RSYNC</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Deploy Django App on ServerStadium VM Using Gunicorn, Supervisor, and Nginx</title>
		<link>https://serverstadium.com/knowledge-base/how-to-deploy-django-app-on-serverstadium-vm-using-gunicorn-supervisor-and-nginx/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Sat, 11 Jun 2022 07:11:17 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=2084</guid>

					<description><![CDATA[<p>A basic guide on deploying the Django app using Gunicorn, Supervisor, and Nginx stack on your ServerStadium VM instance. In this article, I will use Ubuntu 22.04 LTS as the deployment server, Python 3.8, and Django 4.0. TLDR Create a standard user called apps Install supervisor and Nginx Install your App&#8217;s Python version. Install pip&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/how-to-deploy-django-app-on-serverstadium-vm-using-gunicorn-supervisor-and-nginx/">How to Deploy Django App on ServerStadium VM Using Gunicorn, Supervisor, and Nginx</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">A basic guide on deploying the Django app using Gunicorn, Supervisor, and Nginx stack on your ServerStadium VM instance.</p>



<p class="wp-block-paragraph">In this article, I will use Ubuntu 22.04 LTS as the deployment server, Python 3.8, and Django 4.0.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">TLDR</h2>



<ol class="wp-block-list">
<li>Create a standard user called <strong>apps</strong></li>
<li>Install supervisor and Nginx</li>
</ol>



<pre class="wp-block-code"><code>sudo apt install supervisor nginx -y</code></pre>



<ol class="wp-block-list" start="3">
<li>Install your App&#8217;s Python version.</li>
<li>Install <code>pip</code></li>
<li>Install <code>pipenv</code> globally.</li>
</ol>



<pre class="wp-block-code"><code>sudo pip install pipenv</code></pre>



<ol class="wp-block-list" start="3">
<li>Add your server IP and/or FQDN address to ALLOWED_HOSTS in <code>settings.py</code> file</li>
</ol>



<pre class="wp-block-code"><code>ALLOWED_HOSTS = [ "xx.yy.dd.zz", "your.domain.tld" ]</code></pre>



<ol class="wp-block-list" start="4">
<li>Copy the Django app to <code>/home/apps/django-app</code></li>
<li>Go to the app folder and run:</li>
</ol>



<pre class="wp-block-code"><code>cd /home/apps/django-app
python3.8 -m pipenv install --deploy</code></pre>



<ol class="wp-block-list" start="6">
<li>Install Gunicorn using pipenv on the same directory</li>
</ol>



<pre class="wp-block-code"><code>python3.8 -m pipenv install gunicorn</code></pre>



<ol class="wp-block-list" start="7">
<li>Create supervisor config file under <code>/etc/supervisor/conf.d/django-app.conf</code></li>
</ol>



<pre class="wp-block-code"><code>[program:django-app]
user=apps
directory=/home/apps/django-app/djangoapp/
command=/usr/local/bin/pipenv run gunicorn --workers=3 djangoapp.wsgi

autostart=true
autorestart=true
stdout_logfile=/home/apps/logs/django-app.log
stderr_logfile=/home/apps/logs/django-app.err.log</code></pre>



<ol class="wp-block-list" start="8">
<li>Create the required files and folder:</li>
</ol>



<pre class="wp-block-code"><code>mkdir /home/apps/logs/
touch /home/apps/django-app{,.err}.log</code></pre>



<ol class="wp-block-list" start="9">
<li>Restart supervisor to recognize the app</li>
</ol>



<pre class="wp-block-code"><code>sudo systemctl restart supervisor</code></pre>



<ol class="wp-block-list" start="10">
<li>Create nginx server block file for the app under <code>/etc/nginx/sites-available/django-app.conf</code></li>
</ol>



<pre class="wp-block-code"><code>server {
    listen 80;
    
    location / {
        include proxy_params;
        proxy_pass http://localhost:8000;
    }
}</code></pre>



<ol class="wp-block-list" start="11">
<li>Activate the config and reload nginx</li>
</ol>



<pre class="wp-block-code"><code>sudo ln -s <span style="background-color: inherit; font-family: monospace; font-size: inherit;">/etc/nginx/sites-available/django-app.conf</span> /etc/nginx/sites-enabled
sudo unlink /etc/nginx/sites-enabled/default
sudo nginx -t
sudo nginx -s reload</code></pre>



<ol class="wp-block-list" start="12">
<li>Access the app from your browser: <code>http://your-ip</code> or <code>http://your-domain.tld</code> and DONE!</li>
</ol>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Step-by-step Guide</h2>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Django App Peparation</h3>



<p class="wp-block-paragraph">I will assume that your Django App is ready to be deployed. This means it has Pipfile or requirements.txt. For this tutorial, I&#8217;m going to use <code>pipenv</code> as the virtual environment tool and here&#8217;s the directory structure of the app:</p>



<pre class="wp-block-code"><code>├── djangoapp
│   ├── db.sqlite3
│   ├── djangoapp
│   │   ├── asgi.py
│   │   ├── __init__.py
│   │   ├── settings.py
│   │   ├── urls.py
│   │   └── wsgi.py
│   └── manage.py
├── Pipfile
└── Pipfile.lock</code></pre>



<p class="wp-block-paragraph">Make sure the app runs successfully in our local environment by running the below command on the app directory:</p>



<pre class="wp-block-code"><code>pipenv run djangoapp/manage.py runserver</code></pre>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-2147" src="https://serverstadium.com/wp-content/uploads/2022/06/carbon-1.png" alt="" width="768" height="380" srcset="https://serverstadium.com/wp-content/uploads/2022/06/carbon-1.png 1024w, https://serverstadium.com/wp-content/uploads/2022/06/carbon-1-300x149.png 300w, https://serverstadium.com/wp-content/uploads/2022/06/carbon-1-768x380.png 768w" sizes="(max-width: 768px) 100vw, 768px" /></figure>
</div>


<p class="wp-block-paragraph">Then access your browser with <code>http://127.0.0.1:8000</code></p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-2148" src="https://serverstadium.com/wp-content/uploads/2022/06/image-1.png" alt="" width="886" height="645" /></figure>
</div>


<p class="wp-block-paragraph">Add your server IP and/or domain to ALLOWED_HOST entry in the <code>settings.py</code> file, then save it.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="289" height="103" class="wp-image-2158" src="https://serverstadium.com/wp-content/uploads/2022/06/image-6.png" alt="" />
<figcaption>Allowed hosts configuration</figcaption>
</figure>
</div>


<p class="wp-block-paragraph">Good, now we are ready to do the deployment.</p>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Server Preparation</h3>



<p class="wp-block-paragraph">We will need a specific user that we will use to serve the app, and it should be a non administrative user. To simplify, we will create <strong>apps</strong> user</p>



<pre class="wp-block-code"><code>sudo useradd --create-home --shell /bin/bash apps</code></pre>



<p class="wp-block-paragraph">We will also want to install supervisor and nginx from now</p>



<pre class="wp-block-code"><code>sudo apt update &amp;&amp; sudo apt install supervisor nginx</code></pre>



<p class="wp-block-paragraph">As mentioned earlier, we will be using Python 3.8, which isn&#8217;t available by default, so please take a look at this article on <a href="#" target="_blank" rel="noreferrer noopener">how to install Python 3.8 on Ubuntu 22.04 Jammy</a>. Don&#8217;t forget to install pip as well.</p>



<p class="wp-block-paragraph">Then install <code>pipenv</code> globally:</p>



<pre class="wp-block-code"><code>sudo pip install pipenv</code></pre>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-2151" src="https://serverstadium.com/wp-content/uploads/2022/06/image-2.png" alt="" width="776" height="435" srcset="https://serverstadium.com/wp-content/uploads/2022/06/image-2.png 1034w, https://serverstadium.com/wp-content/uploads/2022/06/image-2-300x168.png 300w, https://serverstadium.com/wp-content/uploads/2022/06/image-2-1024x574.png 1024w, https://serverstadium.com/wp-content/uploads/2022/06/image-2-768x431.png 768w" sizes="(max-width: 776px) 100vw, 776px" />
<figcaption>Installing pipenv</figcaption>
</figure>
</div>


<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Copy App Files</h3>



<p class="wp-block-paragraph">Copy or clone (using git if it&#8217;s supported) the app files to <code>/home/apps/django-app</code>. You can use FTP, SFTP, SCP or any other means of transferring local files to the remote server. On the remote server, the apps directory should look like follows:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="705" height="531" class="wp-image-2150" src="https://serverstadium.com/wp-content/uploads/2022/06/carbon-2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/06/carbon-2.png 705w, https://serverstadium.com/wp-content/uploads/2022/06/carbon-2-300x226.png 300w" sizes="(max-width: 705px) 100vw, 705px" />
<figcaption>django-app folder structure</figcaption>
</figure>
</div>


<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Install Required Dependencies</h3>



<p class="wp-block-paragraph">A good thing about <code>pipenv</code> is that it will automatically create a virtual environment upon installing any required dependencies listed in the Pipfile. So, on the django-app folder run:</p>



<pre class="wp-block-code"><code># make sure it's on /home/apps/django-app
python3.8 -m pipenv install --deploy</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1131" height="258" class="wp-image-2152" src="https://serverstadium.com/wp-content/uploads/2022/06/image-3.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/06/image-3.png 1131w, https://serverstadium.com/wp-content/uploads/2022/06/image-3-300x68.png 300w, https://serverstadium.com/wp-content/uploads/2022/06/image-3-1024x234.png 1024w, https://serverstadium.com/wp-content/uploads/2022/06/image-3-768x175.png 768w" sizes="(max-width: 1131px) 100vw, 1131px" /></figure>



<p class="wp-block-paragraph">Next, we will install gunicorn:</p>



<pre class="wp-block-code"><code>python3.8 -m pipenv install gunicorn</code></pre>



<p class="wp-block-paragraph">Then, we will try to serve the app using gunicorn to test, but make sure you run the gunicorn from the app folder where <code>manage.py</code> resides:</p>



<pre class="wp-block-code"><code>cd djangoapp/
python3.8 -m pipenv run gunicorn djangoapp.wsgi</code></pre>



<p class="wp-block-paragraph">It should return something like this:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="729" height="77" class="wp-image-2155" src="https://serverstadium.com/wp-content/uploads/2022/06/image-4.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/06/image-4.png 729w, https://serverstadium.com/wp-content/uploads/2022/06/image-4-300x32.png 300w" sizes="(max-width: 729px) 100vw, 729px" />
<figcaption>Serving django via gunicorn</figcaption>
</figure>
</div>


<p class="wp-block-paragraph">Awesome. Now we can setup <code>supervisor</code> to handle gunicorn process(es).</p>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Install and Configure Supervisor</h3>



<p class="wp-block-paragraph">For <strong>Debian-based</strong> distros, run:</p>



<pre class="wp-block-code"><code>sudo apt install supervisor</code></pre>



<p class="wp-block-paragraph">For <strong>RHEL-based</strong> distros, run:</p>



<pre class="wp-block-code"><code>sudo dnf install supervisor
# or
sudo yum install supervisor</code></pre>



<p class="wp-block-paragraph">Then, we will create a config file for the django app in <code>/etc/supervisor/conf.d/</code> and name it as <code>django-app.conf</code>. Write or just copy the following lines to the file:</p>



<pre class="wp-block-code"><code>[program:django-app]
user=apps
directory=/home/apps/django-app/djangoapp
command=/usr/local/bin/pipenv run gunicorn --workers=3 djangoapp.wsgi

autostart=true
autorestart=true
stdout_logfile=/home/apps/logs/django-app.log
stderr_logfile=/home/apps/logs/django-app.err.log</code></pre>



<p class="wp-block-paragraph">Don&#8217;t forget to create the <code>./logs/</code> folder to store the app&#8217;s logs:</p>



<pre class="wp-block-code"><code># as the apps user
mkdir /home/apps/logs</code></pre>



<p class="wp-block-paragraph">Then restart supervisor:</p>



<pre class="wp-block-code"><code>sudo systemctl restart supervisor</code></pre>



<p class="wp-block-paragraph">Make sure it&#8217;s running by checking supervisor status:</p>



<pre class="wp-block-code"><code>sudo systemctl status supervisor</code></pre>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-2156" src="https://serverstadium.com/wp-content/uploads/2022/06/image-5.png" alt="" width="792" height="311" srcset="https://serverstadium.com/wp-content/uploads/2022/06/image-5.png 1056w, https://serverstadium.com/wp-content/uploads/2022/06/image-5-300x118.png 300w, https://serverstadium.com/wp-content/uploads/2022/06/image-5-1024x401.png 1024w, https://serverstadium.com/wp-content/uploads/2022/06/image-5-768x301.png 768w" sizes="(max-width: 792px) 100vw, 792px" />
<figcaption>Supervisor status</figcaption>
</figure>
</div>


<p class="wp-block-paragraph">Next, we will install and configure Nginx so it proxies the connection.</p>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Install and Configure NGINX</h3>



<p class="wp-block-paragraph">Here, nginx will proxy HTTP connections to the gunicorn workers. This will also make SSL setup easier, but I won&#8217;t explain it here. Install nginx and make sure it&#8217;s started on boot:</p>



<pre class="wp-block-code"><code>sudo apt install nginx
sudo systemctl enable nginx --now</code></pre>



<p class="wp-block-paragraph">Then create a new config file in <code>/etc/nginx/sites-available</code> for Ubuntu-based distros, RHEL-based ones should be in <code>/etc/nginx/conf.d</code></p>



<pre class="wp-block-code"><code>server {
    listen 80;
    
    location / {
        include proxy_params;
        proxy_pass http://localhost:8000;
    }
}</code></pre>



<p class="wp-block-paragraph">Save it as <code>django-app.conf</code>. Then for Ubuntu-based distro only, create a symlink in <code>/etc/nginx/sites-enabled/</code> for the config file:</p>



<pre class="wp-block-code"><code>sudo ln -s /etc/nginx/sites-available/django-app.conf /etc/nginx/sites-enabled/django-app.conf</code></pre>



<p class="wp-block-paragraph">Remove the default site config</p>



<pre class="wp-block-code"><code>sudo unlink /etc/nginx/sites-enabled/default</code></pre>



<p class="wp-block-paragraph">For RHEL-based distros, one might need to remove the default config or rename the extension to <code>.bak</code> or something else. Then, test nginx and reload it</p>



<pre class="wp-block-code"><code>sudo nginx -t
sudo nginx -s reload</code></pre>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Access Test</h3>



<p class="wp-block-paragraph">Finally, test it from your browser via <code>http://YOUR-IP</code> or <code>http://YOUR-DOMAIN.TLD</code></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1040" height="541" class="wp-image-2159" src="https://serverstadium.com/wp-content/uploads/2022/06/image-7.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/06/image-7.png 1040w, https://serverstadium.com/wp-content/uploads/2022/06/image-7-300x156.png 300w, https://serverstadium.com/wp-content/uploads/2022/06/image-7-1024x533.png 1024w, https://serverstadium.com/wp-content/uploads/2022/06/image-7-768x400.png 768w" sizes="(max-width: 1040px) 100vw, 1040px" /></figure>



<p class="wp-block-paragraph">Yay! You&#8217;re now able to deploy your Django app!</p>



<p class="wp-block-paragraph"><strong>IMPORTANT NOTE:</strong> This is a basic setup that is insecure. For a complete documentation on how to configure your Django so it fits production deployment, please refer to <a href="https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/" target="_blank" rel="noreferrer noopener nofollow">this official documentation</a></p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">We just learned how to deploy a django application using Pipenv as the virtual environment tool, Gunicorn as the Web Server Gateway, Supervisor as the process manager, and NGINX as the reverse proxy.</p>



<p class="wp-block-paragraph">Find more tutorial articles in ServerStadium&#8217;s <a href="https://serverstadium.com/knowledge-base/" target="_blank" rel="noreferrer noopener">Knowledge Base</a>,  <a href="https://cp.serverstadium.com/regist-user" target="_blank" rel="noreferrer noopener"> Register now</a> for free in ServerStadium&#8217;s panel to try our cloud VMs.</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/how-to-deploy-django-app-on-serverstadium-vm-using-gunicorn-supervisor-and-nginx/">How to Deploy Django App on ServerStadium VM Using Gunicorn, Supervisor, and Nginx</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Set Up WAF KEMP in ServerStadium Part 2</title>
		<link>https://serverstadium.com/knowledge-base/set-up-waf-kemp-in-serverstadium-part-2/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Wed, 25 May 2022 09:29:06 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=2042</guid>

					<description><![CDATA[<p>INTRODUCTION Hello! Still discussing about WAF KEMP; now let&#8217;s continue to add setup some WAF rules on the SubVS of virtual services. Kemp Web Application Firewall (WAF) services are natively integrated into the Kemp LoadMaster. This enables secure deployment of web applications, preventing Layer 7 attacks while maintaining core load balancing services and ensuring superior&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/set-up-waf-kemp-in-serverstadium-part-2/">Set Up WAF KEMP in ServerStadium Part 2</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">INTRODUCTION</h2>



<p class="wp-block-paragraph">Hello! Still discussing about WAF KEMP; now let&#8217;s continue to add setup some WAF rules on the <strong>SubVS </strong>of <strong>virtual services.</strong></p>



<p class="wp-block-paragraph">Kemp Web Application Firewall (WAF) services are natively integrated into the Kemp LoadMaster. This enables secure deployment of web applications, preventing Layer 7 attacks while maintaining core load balancing services and ensuring superior application delivery and security. WAF functionality directly augments the LoadMaster&#8217;s existing security features to create a layered defense for web applications &#8211; enabling safe, compliant, and productive use of published services.</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">WAF KEMP DEFAULT RULES</h2>



<p class="wp-block-paragraph">KEMP WAF has default rules that update daily.</p>



<p class="wp-block-paragraph">This setting can be found at <strong>Web Application Firewall &gt; Access Settings.</strong></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="776" height="269" class="wp-image-2044" src="https://serverstadium.com/wp-content/uploads/2022/04/KEMP-Default-RULES.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/04/KEMP-Default-RULES.png 776w, https://serverstadium.com/wp-content/uploads/2022/04/KEMP-Default-RULES-300x104.png 300w, https://serverstadium.com/wp-content/uploads/2022/04/KEMP-Default-RULES-768x266.png 768w" sizes="(max-width: 776px) 100vw, 776px" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">WAF KEMP CUSTOM RULES</h2>



<p class="wp-block-paragraph">You can also write and upload your own custom rules if required.</p>



<p class="wp-block-paragraph">With the WAF-enabled LoadMaster, you can choose whether to use Kemp-provided rules, custom rules which can be uploaded, or a combination of both.</p>



<p class="wp-block-paragraph">The writing in WAF KEMP has a similar syntax to ModSec writing rules.</p>



<p class="wp-block-paragraph">The ModSecurity Reference Manual should be consulted in any cases where questions arise relating to the syntax of commands: <a href="https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual">https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual</a></p>



<p class="wp-block-paragraph">After writing some custom rules, you can upload them to KEMP through the following menu.</p>



<p class="wp-block-paragraph"><strong>Web Application Firewall &gt; Custom Rules</strong> <strong>&gt; Browse &gt; Add Ruleset</strong></p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-2045" src="https://serverstadium.com/wp-content/uploads/2022/04/KEMP-custom-rules.png" alt="" width="752" height="274" srcset="https://serverstadium.com/wp-content/uploads/2022/04/KEMP-custom-rules.png 1413w, https://serverstadium.com/wp-content/uploads/2022/04/KEMP-custom-rules-300x109.png 300w, https://serverstadium.com/wp-content/uploads/2022/04/KEMP-custom-rules-1024x373.png 1024w, https://serverstadium.com/wp-content/uploads/2022/04/KEMP-custom-rules-768x280.png 768w" sizes="(max-width: 752px) 100vw, 752px" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">WAF KEMP DEMO</h2>



<p class="wp-block-paragraph">I&#8217;ve added some rules that block access from my device IP. The rules syntax is as the following:</p>



<pre class="wp-block-code"><code>SecRule REMOTE_ADDR "@ipMatch 125.164.9.70" \
id:99999,phase:1,t:none,log,deny,ctl:ruleEngine=off</code></pre>



<p class="wp-block-paragraph">If the rule is applied to the <strong>SubVs</strong>, my device will get an <strong>Access denied </strong>message from accessing the website.</p>



<p class="wp-block-paragraph">Now go to <strong>Virtual Services &gt; your 443 or 80 Virtual IP Address &gt; your SubVSs</strong> <strong>&gt; Modify</strong></p>



<p class="wp-block-paragraph">To enable the WAF rules, <strong>check </strong>the <strong>Enabled </strong>box on the <strong>WAF </strong>panel.</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-2047" src="https://serverstadium.com/wp-content/uploads/2022/04/WAF-enabled.png" alt="" width="764" height="394" srcset="https://serverstadium.com/wp-content/uploads/2022/04/WAF-enabled.png 1354w, https://serverstadium.com/wp-content/uploads/2022/04/WAF-enabled-300x155.png 300w, https://serverstadium.com/wp-content/uploads/2022/04/WAF-enabled-1024x528.png 1024w, https://serverstadium.com/wp-content/uploads/2022/04/WAF-enabled-768x396.png 768w" sizes="(max-width: 764px) 100vw, 764px" /></figure>



<p class="wp-block-paragraph">To apply the BLOCK-IP.conf WAF custom rule, just scroll down the rules on the <strong>Manage Rules </strong>column, check the <strong>BLOCK-IP </strong>rules, and apply them to the <strong>SubVs</strong>.</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-2049" src="https://serverstadium.com/wp-content/uploads/2022/04/BLOCK-ip.png" alt="" width="765" height="242" /></figure>



<p class="wp-block-paragraph">Here is the result before and after the rules, applied to the <strong>SubVs.</strong></p>



<p class="wp-block-paragraph"><strong>Before applying the rule</strong></p>



<figure class="wp-block-image size-full"><img decoding="async" class="wp-image-2051" src="https://serverstadium.com/wp-content/uploads/2022/04/before-applied-1.png" alt="" /></figure>



<p class="wp-block-paragraph"><strong>After applying the rule</strong></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="495" height="148" class="wp-image-2052" src="https://serverstadium.com/wp-content/uploads/2022/04/after-applied.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/04/after-applied.png 495w, https://serverstadium.com/wp-content/uploads/2022/04/after-applied-300x90.png 300w" sizes="(max-width: 495px) 100vw, 495px" /></figure>



<p class="wp-block-paragraph">You can also inspect the <strong>WAF Event log</strong> to see if the rule is read by the system.</p>


<p>2022-04-09T19:28:51+00:00 lb100 wafd: [client 125.164.9.70] ModSecurity: Access denied with code 403 (phase 1). IPmatch: &#8220;125.164.9.70&#8221; matched at REMOTE_ADDR. [file &#8220;/tmp/waf/6/BLOCK-IP.conf&#8221;] [line &#8220;2&#8221;] [id &#8220;99999&#8221;] [hostname &#8220;6.5 (subahmadcloud)&#8221;] [uri &#8220;/&#8221;] [unique_id &#8220;dce9c392-cd01-490f-adaf-755c64e3242a&#8221;] 2022-04-09T19:28:52+00:00 lb100 wafd: [client 125.164.9.70] ModSecurity: Access denied with code 403 (phase 1). IPmatch: &#8220;125.164.9.70&#8221; matched at REMOTE_ADDR. [file &#8220;/tmp/waf/6/BLOCK-IP.conf&#8221;] [line &#8220;2&#8221;] [id &#8220;99999&#8221;] [hostname &#8220;6.5 (subahmadcloud)&#8221;] [uri &#8220;/&#8221;] [unique_id &#8220;c19d2e9e-c2c5-4c35-a6fc-c63235f5eb35&#8221;] 2022-04-09T19:35:28+00:00 lb100 wafd: [client 125.164.9.70] ModSecurity: Access denied with code 403 (phase 1). IPmatch: &#8220;125.164.9.70&#8221; matched at REMOTE_ADDR. [file &#8220;/tmp/waf/6/BLOCK-IP.conf&#8221;] [line &#8220;2&#8221;] [id &#8220;99999&#8221;] [hostname &#8220;6.5 (subahmadcloud)&#8221;] [uri &#8220;/&#8221;] [unique_id &#8220;87c30379-753d-4632-8e86-48256ce6dc44&#8221;] 2022-04-09T19:35:29+00:00 lb100 wafd: [client 125.164.9.70] ModSecurity: Access denied with code 403 (phase 1). IPmatch: &#8220;125.164.9.70&#8221; matched at REMOTE_ADDR. [file &#8220;/tmp/waf/6/BLOCK-IP.conf&#8221;] [line &#8220;2&#8221;] [id &#8220;99999&#8221;] [hostname &#8220;6.5 (subahmadcloud)&#8221;] [uri &#8220;/&#8221;] [unique_id &#8220;a507ea93-eec2-41d1-9532-4978db0f06c7&#8221;]</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">CONCLUSION</h2>



<p class="wp-block-paragraph">Though it is a long work process, it is still worth starting with. If you miss part 1, please read it <strong>here.</strong></p>
<p>The post <a href="https://serverstadium.com/knowledge-base/set-up-waf-kemp-in-serverstadium-part-2/">Set Up WAF KEMP in ServerStadium Part 2</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Set Up WAF KEMP in ServerStadium Part 1</title>
		<link>https://serverstadium.com/knowledge-base/set-up-waf-kemp-in-serverstadium-part-1/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Wed, 25 May 2022 05:06:07 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=1901</guid>

					<description><![CDATA[<p>While KEMP LoadMaster can bring a solution to distribute the web workload, KEMP also has a feature to harden the Web Application by utilizing the WAF (Web Application Firewall). WAF or Web Application Firewall helps protect web applications by filtering and monitoring HTTP/s traffic between a web application and the internet. The typical protection of&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/set-up-waf-kemp-in-serverstadium-part-1/">Set Up WAF KEMP in ServerStadium Part 1</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">While KEMP LoadMaster can bring a solution to distribute the web workload, KEMP also has a feature to harden the Web Application by utilizing the WAF (Web Application Firewall).</p>



<p class="wp-block-paragraph">WAF or Web Application Firewall helps protect web applications by filtering and monitoring HTTP/s traffic between a web application and the internet. The typical protection of WAF can provide, such as cross-site forgery, cross-site-scripting (XSS), file inclusion, and SQL injection.</p>



<p class="wp-block-paragraph">The original product of KEMP Technologies can be found at https://kemptechnologies.com/</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Licensing</h2>



<p class="wp-block-paragraph">KEMP VLM has two types of licenses, the paid one and the trial one.</p>



<p class="wp-block-paragraph">You can go with the paid license for a production environment since it will unlock all KEMP VLM&#8217;s features.</p>



<p class="wp-block-paragraph">However, we will go with the trial license in this section since we don&#8217;t need to go to a production environment yet.</p>

<p>Please register your account <a href="https://sso.kemp.ax/register/kemp/vlm?sfstate=AQAAAAQAAAAJLnJlZGlyZWN0KC9TaXRlZmluaXR5L0F1dGhlbnRpY2F0ZS9PcGVuSUQvY2FsbGJhY2sIc2lnbmluaWQgNjI3MDMyYWNkNWQ5OGMwNWU4OWY3NDFlNjIwMzVhODUYa2F0YW5hQXV0aGVudGljYXRpb25UeXBlGktlbXBBdXRoZW50aWNhdGlvblByb3ZpZGVyCmluaXRpYWxVcmw0aHR0cHM6Ly9rZW1wdGVjaG5vbG9naWVzLmNvbS92bG0tZG93bmxvYWQtaHlwZXJ2aXNvcg2">Here &#8211; Start Free Trial</a> to get your free trial license.</p>

<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Create Virtual Machine</h2>

<p>First, you must deploy<a href="https://serverstadium.com/knowledge-base/deploying-a-virtual-machine-in-serverstadium/" target="_blank" rel="noopener"> a Virtual Machine</a> with KEMP VLM as a template image.</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-1904" src="https://serverstadium.com/wp-content/uploads/2022/04/Image-1.png" alt="" width="536" height="543" srcset="https://serverstadium.com/wp-content/uploads/2022/04/Image-1.png 536w, https://serverstadium.com/wp-content/uploads/2022/04/Image-1-296x300.png 296w" sizes="(max-width: 536px) 100vw, 536px" /></p>
<p>Access the KEMP management UI and set the new password for the administrator. Please set the password so that it will fulfill the complexity requirements.</p>
<p>The management interface should be like in this picture.</p>

<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-1907" src="https://serverstadium.com/wp-content/uploads/2022/04/Image-2.png" alt="" width="611" height="530" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Additional Private IP + Public IP</h2>



<p class="wp-block-paragraph">You need to create additional private IP and public IP since the default private IP and public IP will be used as the management interface. Please follow the steps below to add new IP to an existing VM.</p>



<ul class="wp-block-list">
<li>Navigate to KEMP VM, click <strong>Public &amp; Private IP</strong></li>
<li>Click <strong>Acquire New Private IP </strong></li>
<li>Click <strong>Acquire new Public IP</strong>, and attach the public IP to the new Private IP</li>
<li>Your newly acquired IP should be like in the following picture</li>
</ul>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-1972" src="https://serverstadium.com/wp-content/uploads/2022/04/Image-4-2.png" alt="" width="765" height="231" srcset="https://serverstadium.com/wp-content/uploads/2022/04/Image-4-2.png 1458w, https://serverstadium.com/wp-content/uploads/2022/04/Image-4-2-300x91.png 300w, https://serverstadium.com/wp-content/uploads/2022/04/Image-4-2-1024x310.png 1024w, https://serverstadium.com/wp-content/uploads/2022/04/Image-4-2-768x232.png 768w" sizes="(max-width: 765px) 100vw, 765px" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Rules &amp; Checking</h2>



<h4 class="wp-block-heading">Content Rules</h4>



<p class="wp-block-paragraph">Content Rules are needed because if two different websites use the same 1 IP on the SubVirtul Real server (SubVR), only the website in the last order can be accessed.</p>



<p class="wp-block-paragraph">Example:</p>



<figure class="wp-block-image size-full"><img decoding="async" class="wp-image-2036" src="https://serverstadium.com/wp-content/uploads/2022/04/content-tules-1.png" alt="" /></figure>



<p class="wp-block-paragraph">Assigned the <strong>content rules </strong>to each <strong>SubVS</strong></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1365" height="127" class="wp-image-2037" src="https://serverstadium.com/wp-content/uploads/2022/04/content-rules2.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/04/content-rules2.png 1365w, https://serverstadium.com/wp-content/uploads/2022/04/content-rules2-300x28.png 300w, https://serverstadium.com/wp-content/uploads/2022/04/content-rules2-1024x95.png 1024w, https://serverstadium.com/wp-content/uploads/2022/04/content-rules2-768x71.png 768w" sizes="(max-width: 1365px) 100vw, 1365px" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Virtual Services</h2>



<p class="wp-block-paragraph"><strong>Virtual Services</strong> will contain an HTTP/s service held by the backend webserver.</p>



<ul class="wp-block-list">
<li>On the left pane, click <strong>add new</strong></li>
<li>Specify the parameter below:</li>
</ul>



<figure class="wp-block-table">
<table>
<tbody>
<tr>
<td><strong>Name</strong></td>
<td><strong>Value</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td>Virtual Address</td>
<td>10.1.1.108</td>
<td>Private IP of KEMP Machine</td>
</tr>
<tr>
<td>Port</td>
<td>80 or 443</td>
<td>common HTTP/s port service</td>
</tr>
<tr>
<td>Service Name (Optional)</td>
<td>http / https</td>
<td>Optional name of the service</td>
</tr>
<tr>
<td>Protocol</td>
<td>tcp</td>
<td>transport protocol with a reliable connection</td>
</tr>
</tbody>
</table>
</figure>



<p class="wp-block-paragraph">Example of virtual service configuration</p>



<figure class="wp-block-image size-full"><img decoding="async" class="wp-image-2000" src="https://serverstadium.com/wp-content/uploads/2022/04/Image-3-1.png" alt="" /></figure>



<ul class="wp-block-list">
<li>Save the <strong>Virtual Services </strong>value by clicking <b>the Add this Virtual Service button at the right </b>pane.</li>
</ul>



<h3 class="wp-block-heading"><strong>Adding and Modifying the SubVS</strong></h3>



<p class="wp-block-paragraph">This <strong>SubVS </strong>will contain each virtual host configuration of the domain.</p>



<ul class="wp-block-list">
<li>Navigate to Virtual Services &gt; <strong>View/Modify Services</strong></li>
<li>In the <strong>SubVSs </strong>row, click <strong>Add New </strong>button on the right of the pane</li>
<li>For HTTP <strong>SubVs</strong>, we only need to set a nickname and add HTTP as a <strong>Real Server </strong>protocol</li>
<li><strong>Real Server </strong>will be the webserver behind the KEMP VLM</li>
</ul>



<p class="wp-block-paragraph">Example of HTTP <strong>SubVs </strong>and <strong>Real Server</strong> configuration</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="506" height="285" class="wp-image-2007" src="https://serverstadium.com/wp-content/uploads/2022/04/HTTP-RealServer.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/04/HTTP-RealServer.png 506w, https://serverstadium.com/wp-content/uploads/2022/04/HTTP-RealServer-300x169.png 300w" sizes="(max-width: 506px) 100vw, 506px" /></figure>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" class="wp-image-2009" src="https://serverstadium.com/wp-content/uploads/2022/04/HTTP-SubVS.png" alt="" width="761" height="621" srcset="https://serverstadium.com/wp-content/uploads/2022/04/HTTP-SubVS.png 971w, https://serverstadium.com/wp-content/uploads/2022/04/HTTP-SubVS-300x245.png 300w, https://serverstadium.com/wp-content/uploads/2022/04/HTTP-SubVS-768x627.png 768w" sizes="(max-width: 761px) 100vw, 761px" /></figure>



<h3 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">HTTPS Virtual Service</h3>



<p class="wp-block-paragraph">Assuming you have an SSL certificate and want access to your domain through an HTTPS connection.</p>



<p class="wp-block-paragraph">First, Please create <strong>Virtual Services </strong>with 443 as a listening port.</p>





<p class="wp-block-paragraph">You may set the <strong>Real Server </strong>with an 80 port since the SSL termination will be on the KEMP side.</p>



<h4 class="wp-block-heading">Certificate &amp; Security</h4>

<p>Import the SSL certificate of your domain to <a href="https://support.kemptechnologies.com/hc/en-us/articles/115003853166-How-To-Import-SSL-Certificates-To-Your-LoadMaster" target="_blank" rel="noopener">KEMP LoadMaster</a>.</p>
<p>Then assign the available certificate to 443 <strong>Virtual Services</strong></p>

<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="970" height="297" class="wp-image-2038" src="https://serverstadium.com/wp-content/uploads/2022/04/ssl.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/04/ssl.png 970w, https://serverstadium.com/wp-content/uploads/2022/04/ssl-300x92.png 300w, https://serverstadium.com/wp-content/uploads/2022/04/ssl-768x235.png 768w" sizes="(max-width: 970px) 100vw, 970px" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading">Conclusion</h2>

<p>Almost there! We will continue to add some WAF rules in the next part. Please visit article part 2!</p><p>The post <a href="https://serverstadium.com/knowledge-base/set-up-waf-kemp-in-serverstadium-part-1/">Set Up WAF KEMP in ServerStadium Part 1</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Using the SSH key Feature in ServerStadium Dashboard</title>
		<link>https://serverstadium.com/knowledge-base/using-the-ssh-key-feature-in-serverstadium-dashboard/</link>
		
		<dc:creator><![CDATA[Brian K]]></dc:creator>
		<pubDate>Wed, 13 Apr 2022 03:58:44 +0000</pubDate>
				<guid isPermaLink="false">https://cloudraya.com/knowledge-base/?p=1911</guid>

					<description><![CDATA[<p>In ServerStadium, we have several ways to access our VM. If we want to securely access the VM, we can use the SSH key feature. It is really simple to generate the SSH key because ServerStadium will help us to generate and insert it into the VM. Below are the steps that we can follow:&#8230;</p>
<p>The post <a href="https://serverstadium.com/knowledge-base/using-the-ssh-key-feature-in-serverstadium-dashboard/">Using the SSH key Feature in ServerStadium Dashboard</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In ServerStadium, we have several ways to access our VM. If we want to securely access the VM, we can use the SSH key feature.</p>



<p class="wp-block-paragraph">It is really simple to generate the SSH key because ServerStadium will help us to generate and insert it into the VM. Below are the steps that we can follow:</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Create SSH Ke</strong>y</h2>



<p class="wp-block-paragraph">After <a href="https://cp.serverstadium.com/" target="_blank" rel="noreferrer noopener">login into the ServerStadium dashboard</a>, we can click <strong>Networking </strong>then Choose <strong>SSH</strong>. <br />Change the Location to &#8220;<strong>Surabaya</strong>&#8220;.<br />In the right pane, we can click the &#8220;<strong>Create SSH</strong>&#8221; key button to generate the SSH key.</p>



<figure class="wp-block-image size-full"><img decoding="async" class="wp-image-1912" src="https://serverstadium.com/wp-content/uploads/2022/04/image.png" alt="" /></figure>



<p class="wp-block-paragraph">Then, it will display a new screen and fill it as follow :</p>



<figure class="wp-block-image size-full"><img decoding="async" class="wp-image-2023" src="https://serverstadium.com/wp-content/uploads/2022/04/create-1.png" alt="" /></figure>



<p class="wp-block-paragraph">After we click Create New SSH key button, our SSH key will be listed on the SSH list.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1310" height="213" class="wp-image-2025" src="https://serverstadium.com/wp-content/uploads/2022/04/download-ssh.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/04/download-ssh.png 1310w, https://serverstadium.com/wp-content/uploads/2022/04/download-ssh-300x49.png 300w, https://serverstadium.com/wp-content/uploads/2022/04/download-ssh-1024x166.png 1024w, https://serverstadium.com/wp-content/uploads/2022/04/download-ssh-768x125.png 768w" sizes="(max-width: 1310px) 100vw, 1310px" /></figure>



<p class="wp-block-paragraph">Click the &#8220;Download&#8221; button and save the private key to your computer or server that we will use to connect to the VM in ServerStadium.</p>



<figure class="wp-block-image size-full"><img decoding="async" class="wp-image-1924" src="https://serverstadium.com/wp-content/uploads/2022/04/ssh-key.cr_.png" alt="" /></figure>



<p class="wp-block-paragraph">&nbsp;</p>



<p class="wp-block-paragraph">After downloading the SSH, the ServerStadium dashboard will display the SSH key name.</p>



<figure class="wp-block-image size-full"><img decoding="async" class="wp-image-1926" src="https://serverstadium.com/wp-content/uploads/2022/04/image-4.png" alt="" /></figure>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><br /><strong>Create VM using SSH Key</strong></h2>



<p class="wp-block-paragraph">Next, we can continue creating the VM using the SSH key. <br />Click Add VM and in the right pane, choose the <strong>SSH Key</strong> with <strong>ssh-key-cr</strong>. <br />Choose the OS image; in this tutorial, we will use Ubuntu 20.04. <br />Click next until the VM is created.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1157" height="422" class="wp-image-1927" src="https://serverstadium.com/wp-content/uploads/2022/04/image-5.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/04/image-5.png 1157w, https://serverstadium.com/wp-content/uploads/2022/04/image-5-300x109.png 300w, https://serverstadium.com/wp-content/uploads/2022/04/image-5-1024x373.png 1024w, https://serverstadium.com/wp-content/uploads/2022/04/image-5-768x280.png 768w" sizes="(max-width: 1157px) 100vw, 1157px" /></figure>



<p class="wp-block-paragraph">After the VM has been created, we can see SSH key Name on the bottom right specification of the VM.</p>



<figure class="wp-block-image size-full"><img decoding="async" class="wp-image-1928" src="https://serverstadium.com/wp-content/uploads/2022/04/image-6.png" alt="" /></figure>



<p class="wp-block-paragraph">It means we are ready to access the VM using the SSH key.</p>



<p class="wp-block-paragraph"><strong>Access the server using the SSH key</strong></p>



<p class="wp-block-paragraph">Now, we will verify the Private key that we have downloaded previously.<br />Login to your PC or server, then copy the downloaded private key. Change the permission of the private key as follow</p>



<pre class="wp-block-preformatted"># chmod 400 ssh-key-cr</pre>



<p class="wp-block-paragraph">Connect your VM in ServerStadium using a command.</p>



<p class="wp-block-paragraph">ssh -i ssh-key-cr 199.180.xx.xx <br />or <br />ssh -i ssh-key-cr IP_Address_ServerStadium</p>



<figure class="wp-block-image size-full"><img decoding="async" class="wp-image-1934" src="https://serverstadium.com/wp-content/uploads/2022/04/CR.png" alt="" /></figure>



<p class="wp-block-paragraph">&nbsp;</p>



<h2 class="has-vivid-cyan-blue-color has-text-color wp-block-heading"><strong>Add SSH key before the SSH key feature displayed in the previous VM</strong></h2>



<p class="wp-block-paragraph">SSH key feature will be working on the new VM. We can still use the SSH key feature for the previous VM that was deployed. We can follow the steps below:</p>



<p class="wp-block-paragraph">Login to the VM where we will enable the SSH key, then edit /etc/cloud/cloud.cfg as follow:</p>



<figure class="wp-block-image size-full"><img decoding="async" class="wp-image-1943" src="https://serverstadium.com/wp-content/uploads/2022/04/cloud.cfg_.png" alt="" /></figure>



<p class="wp-block-paragraph">Save the file, then stop or shut down the VM. In Detail Information of the VM, click <strong>Reset SSH Key</strong>.</p>



<figure class="wp-block-image size-full"><img decoding="async" class="wp-image-1938" src="https://serverstadium.com/wp-content/uploads/2022/04/image-8.png" alt="" /></figure>



<p class="wp-block-paragraph">Choose the SSH key that we want to use &#8220;ssh-key-cr&#8221; and tick &#8220;It will perform reset VM root password too&#8221;. After that, click &#8220;Reset SSH&#8221;</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="495" height="428" class="wp-image-2017" src="https://serverstadium.com/wp-content/uploads/2022/04/reset.png" alt="" srcset="https://serverstadium.com/wp-content/uploads/2022/04/reset.png 495w, https://serverstadium.com/wp-content/uploads/2022/04/reset-300x259.png 300w" sizes="(max-width: 495px) 100vw, 495px" /></figure>



<p class="wp-block-paragraph">After all the setting has been configured, start the VM again to use the new configuration.<br />We can ensure the VM using a new configuration by file /root/.ssh/authorized_keys has the public key.</p>



<figure class="wp-block-image size-full"><img decoding="async" class="wp-image-1946" src="https://serverstadium.com/wp-content/uploads/2022/04/ssh.png" alt="" /></figure>



<p class="wp-block-paragraph">Now your VM in ServerStadium Cloud is using the SSH key. Please don&#8217;t hesitate to contact our support if you have difficulties using the SSH key.</p>



<p class="wp-block-paragraph">Find more tutorial articles in <strong><a href="https://serverstadium.com/knowledge-base/" target="_blank" rel="noreferrer noopener">ServerStadium&#8217;s Knowledge Base</a></strong>, </p>
<p>The post <a href="https://serverstadium.com/knowledge-base/using-the-ssh-key-feature-in-serverstadium-dashboard/">Using the SSH key Feature in ServerStadium Dashboard</a> appeared first on <a href="https://serverstadium.com">ServerStadium</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
