<?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>Uncategorized Archives - Linuxcent</title>
	<atom:link href="https://linuxcent.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>https://linuxcent.com/category/uncategorized/</link>
	<description>Infrastructure security, from the kernel up.</description>
	<lastBuildDate>Tue, 04 Nov 2025 16:49:32 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://linuxcent.com/wp-content/uploads/2026/04/favicon-512x512-1-150x150.png</url>
	<title>Uncategorized Archives - Linuxcent</title>
	<link>https://linuxcent.com/category/uncategorized/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">211632295</site>	<item>
		<title>Supercharge Your Nginx Security: A Practical Guide to Enabling TLS 1.3 on Rocky Linux 9</title>
		<link>https://linuxcent.com/supercharge-your-nginx-security-a-practical-guide-to-enabling-tls-1-3-on-rocky-linux-9/</link>
					<comments>https://linuxcent.com/supercharge-your-nginx-security-a-practical-guide-to-enabling-tls-1-3-on-rocky-linux-9/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Tue, 04 Nov 2025 16:49:32 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://linuxcent.com/?p=1391</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 4</span> <span class="rt-label rt-postfix">minutes</span></span>Alright, let&#8217;s get straight to it. You&#8217;re running a modern web stack on Linux. You&#8217;ve been diligent, you&#8217;ve secured your URL endpoints, and you&#8217;re serving traffic over HTTPS using TLS 1.2. That&#8217;s a solid baseline. But in the world of infrastructure, standing still is moving backward. TLS 1.3 has been the standard for a while ... <a title="Supercharge Your Nginx Security: A Practical Guide to Enabling TLS 1.3 on Rocky Linux 9" class="read-more" href="https://linuxcent.com/supercharge-your-nginx-security-a-practical-guide-to-enabling-tls-1-3-on-rocky-linux-9/" aria-label="Read more about Supercharge Your Nginx Security: A Practical Guide to Enabling TLS 1.3 on Rocky Linux 9">Read more</a></p>
<p>The post <a href="https://linuxcent.com/supercharge-your-nginx-security-a-practical-guide-to-enabling-tls-1-3-on-rocky-linux-9/">Supercharge Your Nginx Security: A Practical Guide to Enabling TLS 1.3 on Rocky Linux 9</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 4</span> <span class="rt-label rt-postfix">minutes</span></span><p>Alright, let&#8217;s get straight to it. You&#8217;re running a modern web stack on Linux. You&#8217;ve been diligent, you&#8217;ve secured your URL endpoints, and you&#8217;re serving traffic over HTTPS using TLS 1.2. That&#8217;s a solid baseline. But in the world of infrastructure, standing still is moving backward. TLS 1.3 has been the standard for a while now, and it’s not just an incremental update; it&#8217;s a significant leap forward in both security and performance.</p>
<p>The good news? If you&#8217;re on a current platform like Rocky Linux 9.6, you&#8217;re already 90% of the way there. The underlying components are in place. This guide is the final 10%—a no-nonsense, command-line focused walkthrough to get you from TLS 1.2 to the faster, more secure TLS 1.3, complete with the validation steps and pro-tips to make it production-ready.</p>
<h2>Prerequisites Check: Ensure that your OS is updated to the latest and we&#8217;re Good to Go</h2>
<p>Before we touch any configuration files, let&#8217;s confirm your environment is ready. Enabling TLS 1.3 depends on two critical pieces of software: your web server (Nginx) and the underlying cryptography library (OpenSSL).</p>
<ul>
<li><strong>Nginx:</strong> You need version 1.13.0 or newer.</li>
<li><strong>OpenSSL:</strong> You need version 1.1.1 or newer.</li>
</ul>
<p>Rocky Linux 9.6 and its siblings in the RHEL 9 family ship with versions far newer than these minimums. Let&#8217;s verify it. SSH into your server and run this command:</p>
<pre><code class="" data-line="">nginx -V</code></pre>
<p>The output will be verbose, but you&#8217;re looking for two lines. You&#8217;ll see something like this (your versions may differ slightly):</p>
<pre><code class="" data-line="">nginx version: nginx/1.26.x
built with OpenSSL 3.2.x ...</code></pre>
<p>With Nginx and OpenSSL versions well above the minimum, we&#8217;re cleared for takeoff.</p>
<h2>The Upgrade: Configuring Nginx for TLS 1.3</h2>
<p>This is where the rubber meets the road. The process involves a single, targeted change to your Nginx configuration.</p>
<h3>Step 1: Locate Your Nginx Server Block</h3>
<p>Your SSL configuration is defined within a <code class="" data-line="">server</code> block in your Nginx files. If you have a simple setup, this might be in <code class="" data-line="">/etc/nginx/nginx.conf</code>. However, the best practice is to have separate configuration files for each site in <code class="" data-line="">/etc/nginx/conf.d/</code>.</p>
<p>Find the relevant file for the site you want to upgrade. It will contain the <code class="" data-line="">listen 443 ssl;</code> directive and your <code class="" data-line="">ssl_certificate</code> paths.</p>
<h3>Step 2: Modify the ssl_protocols Directive</h3>
<p>Inside your <code class="" data-line="">server</code> block, find the line that begins with <code class="" data-line="">ssl_protocols</code>. To enable TLS 1.3 while maintaining compatibility for clients that haven&#8217;t caught up, modify this line to include <code class="" data-line="">TLSv1.3</code>. The best practice is to support both 1.2 and 1.3.</p>
<pre><code class="" data-line=""># BEFORE
# ssl_protocols TLSv1.2;

# AFTER: Add TLSv1.3
ssl_protocols TLSv1.2 TLSv1.3;</code></pre>
<p>It is critical that this directive is inside every <code class="" data-line="">server</code> block where you want TLS 1.3 enabled. Settings are not always inherited from a global <code class="" data-line="">http</code> block as you might expect.</p>
<h2>Validation and Deployment: Trust, but Verify</h2>
<p>A configuration change isn&#8217;t complete until it&#8217;s verified. This two-step process ensures you don&#8217;t break your site and that the change actually worked.</p>
<h3>Step 1: Test and Reload Nginx</h3>
<p>Never apply a new configuration blind. First, run the built-in Nginx test to check for syntax errors:</p>
<pre><code class="" data-line="">sudo nginx -t</code></pre>
<p>If all is well, you&#8217;ll see a success message. Now, gracefully reload Nginx to apply the changes without dropping connections:</p>
<pre><code class="" data-line="">sudo systemctl reload nginx</code></pre>
<h3>Step 2: Verify TLS 1.3 is Active</h3>
<p>Your server is reloaded, but how do you <em>know</em> TLS 1.3 is active? You must verify it with an external tool.</p>
<ul>
<li><strong>Quick Command-Line Check:</strong> For a fast check from your terminal, use <code class="" data-line="">curl</code>:
<pre><code class="" data-line="">curl -I -v --tlsv1.3 --tls-max 1.3 https://your-domain.com</code></pre>
<p>	Look for output confirming a successful connection using TLSv1.3.</li>
<li><strong>The Gold Standard:</strong> The most comprehensive way to verify your setup is with the <strong>Qualys SSL Labs SSL Server Test</strong>. Navigate to their website, enter your domain name, and run a scan. In the &#8220;Configuration&#8221; section of the report, you will see a heading for &#8220;Protocols.&#8221; If your setup was successful, you will see a definitive &#8220;Yes&#8221; next to <strong>TLS 1.3</strong>.</li>
</ul>
<h2>Advanced Hardening: Pro-Tips for Production</h2>
<p>You&#8217;ve enabled a modern protocol. Now, let&#8217;s enforce its use and add other layers of security that a production environment demands.</p>
<h3>Pro-Tip 1: Implement HSTS (HTTP Strict Transport Security)</h3>
<p>HSTS is a header your server sends to tell browsers that they should <em>only</em> communicate with your site using HTTPS. This prevents downgrade attacks. Add this header to your Nginx <code class="" data-line="">server</code> block:</p>
<pre><code class="" data-line="">add_header Strict-Transport-Security &quot;max-age=63072000; includeSubDomains; preload&quot; always;</code></pre>
<ul>
<li><code class="" data-line="">max-age=63072000</code>: Tells the browser to cache this rule for two years.</li>
<li><code class="" data-line="">includeSubDomains</code>: Applies the rule to all subdomains. Use with caution.</li>
<li><code class="" data-line="">preload</code>: Allows you to submit your site to a list built into browsers, ensuring they never connect via HTTP.</li>
</ul>
<h3>Pro-Tip 2: Enable OCSP Stapling</h3>
<p>Online Certificate Status Protocol (OCSP) Stapling improves performance and privacy by allowing your server to fetch the revocation status of its own certificate and &#8220;staple&#8221; it to the TLS handshake. This saves the client from having to make a separate request to the Certificate Authority.</p>
<p>Enable it by adding these lines to your <code class="" data-line="">server</code> block:</p>
<pre><code class="" data-line=""># OCSP Stapling
ssl_stapling on;
ssl_stapling_verify on;
ssl_trusted_certificate /etc/letsencrypt/live/your-domain.com/fullchain.pem; # Use your fullchain certificate
resolver 8.8.8.8 1.1.1.1 valid=300s; # Use public resolvers</code></pre>
<h3>Pro-Tip 3: Modernize Your Cipher Suites</h3>
<p>While TLS 1.3 has its own small set of mandatory, highly secure cipher suites, you can still define the ciphers for TLS 1.2. The <code class="" data-line="">ssl_prefer_server_ciphers</code> directive should be set to <code class="" data-line="">off</code> for TLS 1.3, which is the default in modern Nginx versions, allowing the client&#8217;s more modern cipher preferences to be honored. However, you should still define a strong cipher list for TLS 1.2.</p>
<p>Here is a modern configuration snippet combining these tips:</p>
<pre><code class="" data-line="">server {
    listen 443 ssl http2;
    server_name your-domain.com;

    # SSL Config
    ssl_certificate /path/to/fullchain.pem;
    ssl_certificate_key /path/to/privkey.pem;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_prefer_server_ciphers off;

    # HSTS Header
    add_header Strict-Transport-Security &quot;max-age=63072000; includeSubDomains; preload&quot; always;

    # OCSP Stapling
    ssl_stapling on;
    ssl_stapling_verify on;
    ssl_trusted_certificate /path/to/fullchain.pem;

    # ... other configurations ...
}</code></pre>
<h3>TL;DR</h3>
<ul>
<li>Enable TLS 1.3 by adding it to the <code class="" data-line="">ssl_protocols</code> directive in your Nginx server block: <code class="" data-line="">ssl_protocols TLSv1.2 TLSv1.3;</code>. Rocky Linux 9.6 ships with the required Nginx and OpenSSL versions.</li>
<li>Always validate your configuration before and after applying it. Use <code class="" data-line="">sudo nginx -t</code> to check syntax, and then use an external tool like the Qualys SSL Labs test to confirm TLS 1.3 is active on your live domain.</li>
<li>Go beyond the basic setup by implementing advanced hardening. Add the <code class="" data-line="">Strict-Transport-Security</code> (HSTS) header and enable OCSP Stapling to build a truly robust and secure configuration.</li>
</ul>
<hr>
<h2>Conclusion</h2>
<p>Upgrading to TLS 1.3 on a modern stack like Nginx on Rocky Linux 9 is refreshingly simple. The core task is a one-line change. However, as a senior engineer, your job doesn&#8217;t end there. The real &#8220;super hack&#8221; is in the full workflow: making the change, rigorously validating it from an external perspective, and then hardening the configuration with production-grade features like HSTS and OCSP Stapling. By following these steps, you&#8217;ve done more than just flip a switch; you&#8217;ve demonstrably improved your site&#8217;s security posture and performance, confirming your stack is compliant with the latest standards.</p>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Fsupercharge-your-nginx-security-a-practical-guide-to-enabling-tls-1-3-on-rocky-linux-9%2F&amp;linkname=Supercharge%20Your%20Nginx%20Security%3A%20A%20Practical%20Guide%20to%20Enabling%20TLS%201.3%20on%20Rocky%20Linux%209" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Fsupercharge-your-nginx-security-a-practical-guide-to-enabling-tls-1-3-on-rocky-linux-9%2F&amp;linkname=Supercharge%20Your%20Nginx%20Security%3A%20A%20Practical%20Guide%20to%20Enabling%20TLS%201.3%20on%20Rocky%20Linux%209" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Fsupercharge-your-nginx-security-a-practical-guide-to-enabling-tls-1-3-on-rocky-linux-9%2F&amp;linkname=Supercharge%20Your%20Nginx%20Security%3A%20A%20Practical%20Guide%20to%20Enabling%20TLS%201.3%20on%20Rocky%20Linux%209" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Fsupercharge-your-nginx-security-a-practical-guide-to-enabling-tls-1-3-on-rocky-linux-9%2F&amp;linkname=Supercharge%20Your%20Nginx%20Security%3A%20A%20Practical%20Guide%20to%20Enabling%20TLS%201.3%20on%20Rocky%20Linux%209" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Fsupercharge-your-nginx-security-a-practical-guide-to-enabling-tls-1-3-on-rocky-linux-9%2F&amp;linkname=Supercharge%20Your%20Nginx%20Security%3A%20A%20Practical%20Guide%20to%20Enabling%20TLS%201.3%20on%20Rocky%20Linux%209" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Fsupercharge-your-nginx-security-a-practical-guide-to-enabling-tls-1-3-on-rocky-linux-9%2F&amp;linkname=Supercharge%20Your%20Nginx%20Security%3A%20A%20Practical%20Guide%20to%20Enabling%20TLS%201.3%20on%20Rocky%20Linux%209" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Fsupercharge-your-nginx-security-a-practical-guide-to-enabling-tls-1-3-on-rocky-linux-9%2F&amp;linkname=Supercharge%20Your%20Nginx%20Security%3A%20A%20Practical%20Guide%20to%20Enabling%20TLS%201.3%20on%20Rocky%20Linux%209" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Fsupercharge-your-nginx-security-a-practical-guide-to-enabling-tls-1-3-on-rocky-linux-9%2F&#038;title=Supercharge%20Your%20Nginx%20Security%3A%20A%20Practical%20Guide%20to%20Enabling%20TLS%201.3%20on%20Rocky%20Linux%209" data-a2a-url="https://linuxcent.com/supercharge-your-nginx-security-a-practical-guide-to-enabling-tls-1-3-on-rocky-linux-9/" data-a2a-title="Supercharge Your Nginx Security: A Practical Guide to Enabling TLS 1.3 on Rocky Linux 9"></a></p><p>The post <a href="https://linuxcent.com/supercharge-your-nginx-security-a-practical-guide-to-enabling-tls-1-3-on-rocky-linux-9/">Supercharge Your Nginx Security: A Practical Guide to Enabling TLS 1.3 on Rocky Linux 9</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/supercharge-your-nginx-security-a-practical-guide-to-enabling-tls-1-3-on-rocky-linux-9/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1391</post-id>	</item>
		<item>
		<title>Install java on Linux centos</title>
		<link>https://linuxcent.com/install-java-on-linux-centos/</link>
					<comments>https://linuxcent.com/install-java-on-linux-centos/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Wed, 08 Mar 2023 04:31:34 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://linuxcent.com/?p=560</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 3</span> <span class="rt-label rt-postfix">minutes</span></span>In this tutorial we will quickly setup java on linux centos, We will be using the yum command to download the openjdk 1.8 and install [vamshi@node01 ~]$ sudo yum install java-1.8.0-openjdk.x86_64 We have installed the java openjdk 1.8 and we can check the version using java -version [vamshi@node01 ~]$ java -version openjdk version "1.8.0_252" OpenJDK ... <a title="Install java on Linux centos" class="read-more" href="https://linuxcent.com/install-java-on-linux-centos/" aria-label="Read more about Install java on Linux centos">Read more</a></p>
<p>The post <a href="https://linuxcent.com/install-java-on-linux-centos/">Install java on Linux centos</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 3</span> <span class="rt-label rt-postfix">minutes</span></span><p>In this tutorial we will quickly setup java on linux centos,</p>
<p>We will be using the yum command to download the openjdk 1.8 and install</p>
<pre>[vamshi@node01 ~]$ sudo yum install java-1.8.0-openjdk.x86_64</pre>
<p>We have installed the java openjdk 1.8 and we can check the version using java -version</p>
<pre>[vamshi@node01 ~]$ java -version
openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)</pre>
<p>&nbsp;</p>
<p>We make use of the alternatives command in centos which lists if we have any other version of java installed on the machine, and then enabling the default java version on the system wide.</p>
<pre>[vamshi@node01 ~]$ alternatives --list | grep java
java auto /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/bin/java
jre_openjdk auto /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre
jre_1.8.0 auto /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre
jre_1.7.0 auto /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.261-2.6.22.2.el7_8.x86_64/jre</pre>
<pre>[vamshi@node01 ~]$ sudo alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*  1           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/bin/java)
 + 2           java-1.7.0-openjdk.x86_64 (/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.261-2.6.22.2.el7_8.x86_64/jre/bin/java)

Enter to keep the current selection[+], or type selection number: 1</pre>
<p>This enabled openjdk1.8 to be the default version of java.</p>
<p>Setting JAVA_HOME path<br />
In order to set the system JAVA_HOME path on the system we need to export this variable, for the obvious reasons of other programs and users using the classpath such as while using maven or a servlet container.</p>
<p>Now there are two levels we can setup the visibility of JAVA_HOME environment variable.<br />
1. Setup JAVA_HOME for single user profile<br />
We need to update the changes to the ~/.bash_profile</p>
<pre>export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/bin/

PATH=$PATH:$JAVA_HOME

export PATH</pre>
<p>Now we need enforce the changes with reloading the .bash_profile with a simple logout and then login into the system or we can source the file ~/.bash_profile as follows:</p>
<pre>[vamshi@node01 ~]$ source .bash_profile</pre>
<p>Verifying the changes:</p>
<pre>[vamshi@node01 ~]$ echo $PATH
/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/vamshi/.local/bin:/home/vamshi/bin:/home/vamshi/.local/bin:/home/vamshi/bin:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/bin/</pre>
<p>2. Setup JAVA_HOME for the system wide profile and available to all the users.</p>
<pre>[vamshi@node01 ~]$ sudo sh -c "echo -e 'export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/bin/' &gt; /etc/profile.d/java.sh"</pre>
<p>This echo command writes the JAVA_HOME path to the system profile.d and creates a file java.sh which is read system wide level.</p>
<p>Ensure the changes are written to /etc/profile.d/java.sh</p>
<pre>[vamshi@node01 ~]$ cat /etc/profile.d/java.sh
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/bin/</pre>
<p>Now source to apply the changes immediately to the file /etc/profile.d/java.sh as follows</p>
<pre>[vamshi@node01 ~]$ sudo sh -c ' source /etc/profile.d/java.sh '</pre>
<p>Or login to the root account and run the source command</p>
<p>Ensure to run the env command</p>
<pre>[vamshi@node01 ~]$ env  | grep JAVA_HOME
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/bin/
</pre>
<h2>How do I download and install Java on CentOS?</h2>
<p><strong>Install Java On CentOS</strong></p>
<ol>
<li>Install OpenJDK 11. Update the package repository to ensure you download the latest software: sudo yum update. &#8230;</li>
<li>Install OpenJRE 11. Java Runtime Environment 11 (Open JRE 11) is a subset of OpenJDK. &#8230;</li>
<li>Install Oracle Java 11. &#8230;</li>
<li>Install JDK 8. &#8230;</li>
<li>Install JRE 8. &#8230;</li>
<li>Install Oracle Java 12.</li>
</ol>
<h2>Is Java installed on CentOS?</h2>
<p>OpenJDK, the open-source implementation of the Java Platform, is the default Java development and runtime in CentOS 7. The installation is simple and straightforward.</p>
<h2>How do I install Java on Linux?</h2>
<ul>
<li>Java for Linux Platforms</li>
<li>Change to the directory in which you want to install. Type: cd directory_path_name. &#8230;</li>
<li>Move the . tar. gz archive binary to the current directory.</li>
<li>Unpack the tarball and install Java. tar zxvf jre-8u73-linux-i586.tar.gz. The Java files are installed in a directory called jre1. &#8230;</li>
<li>Delete the . tar.</li>
</ul>
<h2>How do I install latest version of Java on CentOS?</h2>
<p>To install OpenJDK 8 JRE using yum, run this command: sudo yum install java-1.8. 0-openjdk.</p>
<h2>Where is java path on CentOS?</h2>
<p>They usually reside in /usr/lib/jvm . You can list them via ll /usr/lib/jvm . The value you need to enter in the field JAVA_HOME in jenkins is /usr/lib/jvm/java-1.8.</p>
<h2>How do I know if java is installed on CentOS 7?</h2>
<ul>
<li>To check the Java version on Linux Ubuntu/Debian/CentOS:</li>
<li>Open a terminal window.</li>
<li>Run the following command: java -version.</li>
<li>The output should display the version of the Java package installed on your system. In the example below, OpenJDK version 11 is installed.</li>
</ul>
<h2>Where is java path set in Linux?</h2>
<p>Steps</p>
<ul>
<li>Change to your home directory. cd $HOME.</li>
<li>Open the . bashrc file.</li>
<li>Add the following line to the file. Replace the JDK directory with the name of your java installation directory. export PATH=/usr/java/&lt;JDK Directory&gt;/bin:$PATH.</li>
<li>Save the file and exit. Use the source command to force Linux to reload the .</li>
</ul>
<h2>How do I install java 14 on Linux?</h2>
<p>Installing OpenJDK 14</p>
<ul>
<li>Step 1: Update APT. &#8230;</li>
<li>Step 2: Download and Install JDK Kit. &#8230;</li>
<li>Step 3: Check Installed JDK Framework. &#8230;</li>
<li>Step 4: Update Path to JDK (Optional) &#8230;</li>
<li>Step 6: Set Up Environment Variable. &#8230;</li>
<li>Step 7: Open Environment File. &#8230;</li>
<li>Step 8: Save Your Changes.</li>
</ul>
<h2>How do I know where java is installed on Linux?</h2>
<p>This depends a bit from your package system &#8230; if the java command works, you can type readlink -f $(which java) to find the location of the java command. On the OpenSUSE system I&#8217;m on now it returns /usr/lib64/jvm/java-1.6. 0-openjdk-1.6. 0/jre/bin/java (but this is not a system which uses apt-get ).</p>
<h2>How do I install java 11 on Linux?</h2>
<p>Installing the 64-Bit JDK 11 on Linux Platforms</p>
<ol>
<li>Download the required file: For Linux x64 systems: jdk-11. interim. &#8230;</li>
<li>Change the directory to the location where you want to install the JDK, then move the . tar. &#8230;</li>
<li>Unpack the tarball and install the downloaded JDK: $ tar zxvf jdk-11. &#8230;</li>
<li>Delete the . tar.</li>
</ol>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Finstall-java-on-linux-centos%2F&amp;linkname=Install%20java%20on%20Linux%20centos" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Finstall-java-on-linux-centos%2F&amp;linkname=Install%20java%20on%20Linux%20centos" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Finstall-java-on-linux-centos%2F&amp;linkname=Install%20java%20on%20Linux%20centos" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Finstall-java-on-linux-centos%2F&amp;linkname=Install%20java%20on%20Linux%20centos" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Finstall-java-on-linux-centos%2F&amp;linkname=Install%20java%20on%20Linux%20centos" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Finstall-java-on-linux-centos%2F&amp;linkname=Install%20java%20on%20Linux%20centos" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Finstall-java-on-linux-centos%2F&amp;linkname=Install%20java%20on%20Linux%20centos" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Finstall-java-on-linux-centos%2F&#038;title=Install%20java%20on%20Linux%20centos" data-a2a-url="https://linuxcent.com/install-java-on-linux-centos/" data-a2a-title="Install java on Linux centos"></a></p><p>The post <a href="https://linuxcent.com/install-java-on-linux-centos/">Install java on Linux centos</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/install-java-on-linux-centos/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">560</post-id>	</item>
		<item>
		<title>Git config setup on linux; Unable to pull or clone from git; fatal: unable to access git; Peer&#8217;s Certificate has expired</title>
		<link>https://linuxcent.com/git-config-setup-on-linux-unable-to-pull-or-clone-from-git-fatal-unable-to-access-git-peers-certificate-has-expired/</link>
					<comments>https://linuxcent.com/git-config-setup-on-linux-unable-to-pull-or-clone-from-git-fatal-unable-to-access-git-peers-certificate-has-expired/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Wed, 08 Mar 2023 04:21:02 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://linuxcent.com/?p=445</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 3</span> <span class="rt-label rt-postfix">minutes</span></span>Facing an issue with pulling the repository while dealing with an expired SSL certificate. [vamshi@workstation ~]$ git pull https://gitlab.linuxcent.com/linuxcent/pipeline-101.git fatal: unable to access 'https://gitlab.linuxcent.com/linuxcent/pipeline-101.git/': Peer's Certificate has expired. [vamshi@workstation ~]$ SSL error while cloning git URL If you have faced the error, then we can work around it by ignoring SSL certificate check and continue ... <a title="Git config setup on linux; Unable to pull or clone from git; fatal: unable to access git; Peer&#8217;s Certificate has expired" class="read-more" href="https://linuxcent.com/git-config-setup-on-linux-unable-to-pull-or-clone-from-git-fatal-unable-to-access-git-peers-certificate-has-expired/" aria-label="Read more about Git config setup on linux; Unable to pull or clone from git; fatal: unable to access git; Peer&#8217;s Certificate has expired">Read more</a></p>
<p>The post <a href="https://linuxcent.com/git-config-setup-on-linux-unable-to-pull-or-clone-from-git-fatal-unable-to-access-git-peers-certificate-has-expired/">Git config setup on linux; Unable to pull or clone from git; fatal: unable to access git; Peer&#8217;s Certificate has expired</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 3</span> <span class="rt-label rt-postfix">minutes</span></span><h2>Facing an issue with pulling the repository while dealing with an expired SSL certificate.</h2>
<pre>[vamshi@workstation ~]$ git pull https://gitlab.linuxcent.com/linuxcent/pipeline-101.git
fatal: unable to access 'https://gitlab.linuxcent.com/linuxcent/pipeline-101.git/': Peer's Certificate has expired.
[vamshi@workstation ~]$</pre>
<h2>SSL error while cloning git URL</h2>
<p>If you have faced the error, then we can work around it by ignoring SSL certificate check and continue working with the git repo.</p>
<pre>[vamshi@workstation ~]$ git clone https://gitlab.linuxcent.com/linuxcent/pipeline-101.git
Cloning into 'pipeline-101'...
fatal: unable to access 'https://gitlab.linuxcent.com/linuxcent/pipeline-101.git/': Peer's Certificate has expired.

</pre>
<p>It doesn&#8217;t allow the clone or pull or push to the gitlab website as its certificate is not valid, and the certificate is unsigned by a Valid CA. In most cases, we will have the corporate gitlab repo in our internal network and not publicly exposed.<br />
We therefore trust the gitlab server as we have a bunch of our code on it.. Why not, I say?<br />
We have to ensure to disable the check for the SSL certificate verification</p>
<p>Set the Variable <code>GIT_SSL_NO_VERIFY=1</code> or <code>GIT_SSL_NO_VERIFY=false</code> and try to execute your previous command.</p>
<pre>[vamshi@workstation ~]$ GIT_SSL_NO_VERIFY=1 git clone https://gitlab.linuxcent.com/linuxcent/pipeline-101.git
Cloning into 'pipeline-101'...
Username for 'https://gitlab.linuxcent.com': vamshi
Password for 'https://vamshi@gitlab.linuxcent.com': 
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.</pre>
<p>Make a permanent entry to system wide user level profiles as below. The following change works at the system level</p>
<pre>[vamshi@workstation ~]$ sudo bash -c "echo -e export GIT_SSL_NO_VERIFY=1 &gt; /etc/profile.d/gitconfig.sh "</pre>
<pre>[vamshi@workstation ~]$ cat /etc/profile.d/gitconfig.sh
export GIT_SSL_NO_VERIFY=false</pre>
<p>The practical use case of setting the environment variable can be made while building container images, using  the <code>GIT_SSL_NO_VERIFY false</code> as an environment variable in Dockerfile and building an image.</p>
<pre>[vamshi@workstation ~]$ cat Dockerfile
FROM jetty:latest
-- CONTENT TRUNCATED --
env GIT_SSL_NO_VERIFY 1
-- CONTENT TRUNCATED --</pre>
<p>We can also setup the container build agent with Jenkins Pipeline code with similar configuration to fetch a gitrepo in our next sessions.</p>
<h2>Why is git clone not working?</h2>
<p>If you have a problem cloning a repository, or using it once it has been created, check the following: Make sure that the path in the git clone call is correct. &#8230; If you have an authorization error, have an administrator check the ACLs in Administration &gt; Repositories &gt; &lt;repoName&gt; &gt; Access.</p>
<h2>How do I fix fatal unable to access?</h2>
<p>How to resolve &#8220;git pull,fatal: unable to access &#8216;https://github.com&#8230; \&#8217;: Empty reply from server&#8221;</p>
<ol>
<li>If you have configured your proxy for a VPN, you need to login to your VPN to use the proxy.</li>
<li>to use it outside the VPN use the unset command: git config &#8211;global &#8211;unset http.proxy.</li>
</ol>
<h2>How do I bypass SSL certificate in git?</h2>
<p>Prepend GIT_SSL_NO_VERIFY=true before every git command run to skip SSL verification. This is particularly useful if you haven&#8217;t checked out the repository yet. Run git config http. sslVerify false to disable SSL verification if you&#8217;re working with a checked out repository already.</p>
<h2>How do I open a cloned git repository?</h2>
<p>Clone Your Github Repository</p>
<ul>
<li>Open Git Bash. If Git is not already installed, it is super simple. &#8230;</li>
<li>Go to the current directory where you want the cloned directory to be added. &#8230;</li>
<li>Go to the page of the repository that you want to clone.</li>
<li>Click on “Clone or download” and copy the URL.</li>
</ul>
<h2>Can not clone from GitHub?</h2>
<p>If you&#8217;re unable to clone a repository, check that:<br />
You can connect using HTTPS. For more information, see &#8220;HTTPS cloning errors.&#8221;<br />
You have permission to access the repository you want to clone. For more information, see &#8220;Error: Repository not found.&#8221;<br />
The default branch you want to clone still exists.</p>
<h2>Do I need git for GitLab?</h2>
<p>To install GitLab on a Linux server, you first need Git software. We explain how to install Git on a server in our Git tutorial. Next, you should download the GitLab omnibus package from the official GitLab website.</p>
<h2>How do I clone a project from GitHub?</h2>
<p>Cloning a repository</p>
<ul>
<li>In the File menu, click Clone Repository.</li>
<li>Click the tab that corresponds to the location of the repository you want to clone. &#8230;</li>
<li>Choose the repository you want to clone from the list.</li>
<li>Click Choose&#8230; and navigate to a local path where you want to clone the repository.</li>
<li>Click Clone.</li>
</ul>
<h2>How do I push code to GitHub?</h2>
<p>Using Command line to PUSH to GitHub</p>
<ul>
<li>Creating a new repository. &#8230;</li>
<li>Open your Git Bash. &#8230;</li>
<li>Create your local project in your desktop directed towards a current working directory. &#8230;</li>
<li>Initialize the git repository. &#8230;</li>
<li>Add the file to the new local repository. &#8230;</li>
<li>Commit the files staged in your local repository by writing a commit message.</li>
</ul>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Fgit-config-setup-on-linux-unable-to-pull-or-clone-from-git-fatal-unable-to-access-git-peers-certificate-has-expired%2F&amp;linkname=Git%20config%20setup%20on%20linux%3B%20Unable%20to%20pull%20or%20clone%20from%20git%3B%20fatal%3A%20unable%20to%20access%20git%3B%20Peer%E2%80%99s%20Certificate%20has%20expired" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Fgit-config-setup-on-linux-unable-to-pull-or-clone-from-git-fatal-unable-to-access-git-peers-certificate-has-expired%2F&amp;linkname=Git%20config%20setup%20on%20linux%3B%20Unable%20to%20pull%20or%20clone%20from%20git%3B%20fatal%3A%20unable%20to%20access%20git%3B%20Peer%E2%80%99s%20Certificate%20has%20expired" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Fgit-config-setup-on-linux-unable-to-pull-or-clone-from-git-fatal-unable-to-access-git-peers-certificate-has-expired%2F&amp;linkname=Git%20config%20setup%20on%20linux%3B%20Unable%20to%20pull%20or%20clone%20from%20git%3B%20fatal%3A%20unable%20to%20access%20git%3B%20Peer%E2%80%99s%20Certificate%20has%20expired" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Fgit-config-setup-on-linux-unable-to-pull-or-clone-from-git-fatal-unable-to-access-git-peers-certificate-has-expired%2F&amp;linkname=Git%20config%20setup%20on%20linux%3B%20Unable%20to%20pull%20or%20clone%20from%20git%3B%20fatal%3A%20unable%20to%20access%20git%3B%20Peer%E2%80%99s%20Certificate%20has%20expired" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Fgit-config-setup-on-linux-unable-to-pull-or-clone-from-git-fatal-unable-to-access-git-peers-certificate-has-expired%2F&amp;linkname=Git%20config%20setup%20on%20linux%3B%20Unable%20to%20pull%20or%20clone%20from%20git%3B%20fatal%3A%20unable%20to%20access%20git%3B%20Peer%E2%80%99s%20Certificate%20has%20expired" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Fgit-config-setup-on-linux-unable-to-pull-or-clone-from-git-fatal-unable-to-access-git-peers-certificate-has-expired%2F&amp;linkname=Git%20config%20setup%20on%20linux%3B%20Unable%20to%20pull%20or%20clone%20from%20git%3B%20fatal%3A%20unable%20to%20access%20git%3B%20Peer%E2%80%99s%20Certificate%20has%20expired" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Fgit-config-setup-on-linux-unable-to-pull-or-clone-from-git-fatal-unable-to-access-git-peers-certificate-has-expired%2F&amp;linkname=Git%20config%20setup%20on%20linux%3B%20Unable%20to%20pull%20or%20clone%20from%20git%3B%20fatal%3A%20unable%20to%20access%20git%3B%20Peer%E2%80%99s%20Certificate%20has%20expired" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Fgit-config-setup-on-linux-unable-to-pull-or-clone-from-git-fatal-unable-to-access-git-peers-certificate-has-expired%2F&#038;title=Git%20config%20setup%20on%20linux%3B%20Unable%20to%20pull%20or%20clone%20from%20git%3B%20fatal%3A%20unable%20to%20access%20git%3B%20Peer%E2%80%99s%20Certificate%20has%20expired" data-a2a-url="https://linuxcent.com/git-config-setup-on-linux-unable-to-pull-or-clone-from-git-fatal-unable-to-access-git-peers-certificate-has-expired/" data-a2a-title="Git config setup on linux; Unable to pull or clone from git; fatal: unable to access git; Peer’s Certificate has expired"></a></p><p>The post <a href="https://linuxcent.com/git-config-setup-on-linux-unable-to-pull-or-clone-from-git-fatal-unable-to-access-git-peers-certificate-has-expired/">Git config setup on linux; Unable to pull or clone from git; fatal: unable to access git; Peer&#8217;s Certificate has expired</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/git-config-setup-on-linux-unable-to-pull-or-clone-from-git-fatal-unable-to-access-git-peers-certificate-has-expired/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">445</post-id>	</item>
		<item>
		<title>How to access Tar files in Linux/Unix</title>
		<link>https://linuxcent.com/how-to-access-tar-files-in-linux-unix/</link>
					<comments>https://linuxcent.com/how-to-access-tar-files-in-linux-unix/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Tue, 07 Mar 2023 05:31:08 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://linuxcent.com/?p=106</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 5</span> <span class="rt-label rt-postfix">minutes</span></span>The Linux tar command abbreviation is “tar archive” released under POSIX standards initially and It now follows the GNU standards Often when you download the files from the internet they are in the .tar, tar.gz. Or tar.bz2 compressed format using either bz2 or gz compression algorithm. If you are familiar with the Opensource then there’s a ... <a title="How to access Tar files in Linux/Unix" class="read-more" href="https://linuxcent.com/how-to-access-tar-files-in-linux-unix/" aria-label="Read more about How to access Tar files in Linux/Unix">Read more</a></p>
<p>The post <a href="https://linuxcent.com/how-to-access-tar-files-in-linux-unix/">How to access Tar files in Linux/Unix</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 5</span> <span class="rt-label rt-postfix">minutes</span></span><p>The Linux <b>tar </b>command abbreviation is “tar archive” released under POSIX standards initially and It now follows the GNU standards</p>
<p>Often when you download the files from the internet they are in the .tar, tar.gz. Or tar.bz2 compressed format using either bz2 or gz compression algorithm.</p>
<p>If you are familiar with the Opensource then there’s a good chance that you would have come across the extensions like Package-name.tar, tar.gz, tar.bz, tar.xz which are standard.</p>
<p>Well most open source software use tarballs to distribute programs/source codes in this format as it offers efficient compression and better organized way of grouping files.</p>
<p>It supports a vast range of compression programs such as gzip, bzip2, xz, lzip, lzma, lzop.</p>
<p>In the following tutorial we will show how to Compress/Extract the files into tar.gz or tgz.</p>
<h2>How to specify the format POSIX Or GNU while using tar Command?</h2>
<pre>[vamshi@linuxcent ]$ tar --format=posix -cf posix.tar *
[vamshi@linuxcent ]$  tar --format=gnu -cf gnu.tar *
[vamshi@linuxcent ]$  file posix.tar gnu.tar 
posix.tar: POSIX tar archive
gnu.tar: POSIX tar archive (GNU)</pre>
<p>GNU is based on an older POSIX format, So that&#8217;s why it says POSIX for both.</p>
<p>To print the contents information of an archived directory, use the directory name as a file name argument in conjunction with <code>--list (-t)</code>. To find out file attributes, include the <code>--verbose (-v)</code> option.</p>
<p>Firstly start off by long listing <code>ls</code> in the present directory we have here:</p>
<pre>vamshi@LinuxCent:~/Linux&gt; ls
Debian-Distro/  OpenSuse-Distro/ README  Redhat-Distro/</pre>
<p>We will now compress the present working directory using Linux GNU&#8217;s tar command line utility.. Creating a tar of the current directory mentioned by Asterisk <code>*</code>. The Options <code>-c</code> creates, <code>-v</code>: Verbose mode, <code>-z</code>: Uses GZIP algorithm<br />
Demonstration shown below:<br />
Either one of the following commands can be used</p>
<pre>vamshi@LinuxCent:~/Linux&gt; tar --gzip -cvf Linux-flavours.tar.gz *
vamshi@LinuxCent:~/Linux&gt; tar -cvzf Linux-flavours.tar.gz *
Debian-Distro/
Debian-Distro/ubuntu.txt
Debian-Distro/debian.txt
Debian-Distro/README-Debian-Distro
Linux-flavours.tar.gz
OpenSuse-Distro/
OpenSuse-Distro/README-Opensuse-Distro
OpenSuse-Distro/opensuse.txt
README
Redhat-Distro/
Redhat-Distro/Fedora/
Redhat-Distro/Fedora/fedora.txt
Redhat-Distro/Centos/
Redhat-Distro/Centos/centos.txt
Redhat-Distro/Centos/CentOS-versions/
Redhat-Distro/Centos/CentOS-versions/centos7.txt
Redhat-Distro/Centos/CentOS-versions/centos5.5.txt
Redhat-Distro/Centos/CentOS-versions/centos6.9.txt
Redhat-Distro/Centos/CentOS-versions/centos5.8.txt
Redhat-Distro/Centos/CentOS-versions/centos6.1.txt
Redhat-Distro/Centos/README-CentOS
Redhat-Distro/README-Redhat-Distro
Redhat-Distro/RHEL-Versions/
Redhat-Distro/RHEL-Versions/redhat5.txt
Redhat-Distro/RHEL-Versions/redhat7.txt
Redhat-Distro/RHEL-Versions/redhat6.txt
Redhat-Distro/RHEL-Versions/redhat8.txt
Redhat-Distro/redhat.txt</pre>
<h2><b>How to List/view Archives</b></h2>
<p>The option<code>-t</code> does a Dry-run of extract operation but only to print the contents of the mentioned compression.</p>
<pre>vamshi@LinuxCent:~/Linux&gt; tar -tvf Linux-flavours.tar.gz
Debian-Distro/
Debian-Distro/ubuntu.txt
Debian-Distro/debian.txt
Debian-Distro/README-Debian-Distro
…</pre>
<h2><b>How to Extracting tar.gz File?</b></h2>
<p>Extracting the tar file using the options <code>-x</code> works out just fine as -x option chooses the tye of decompression based on the compression file type, and the content will be extracted to current working directory.</p>
<p>Here are various extraction options:</p>
<pre>$ tar -xvf Linux-flavours.tar.gz
$ tar -zxvf Linux-flavours.tar.gz
$ tar --gzip -xvf Linux-flavours.tar.gz</pre>
<p>The Filter / Options for compression types:<br />
<code>-z</code> or <code>--gzip</code> : Used for Archival operation for .gzip type<br />
<code>-j</code> -r <code>--bzip2</code>: Used for archival operation for .bzip2 type<br />
[/code]-J[/code] or <code>--xz</code>: User for Archival for .xz type</p>
<h2><b>How to Extract Only Specific Files from a compressed tar archive (tar) File</b></h2>
<p>This doesn&#8217;t require any special option but you have to name the exact file and directory that you want to extract</p>
<pre>[vamshi@linuxcent ~]$ tar -zxvf redmine-4.0.6.tar.gz redmine-4.0.6/bin/about
redmine-4.0.6/bin/about</pre>
<p>Successful in extracting only the <code>redmine-4.0.6/bin/about</code> file from the <code>redmine-4.0.6.tar.gz</code> archive.</p>
<pre>[vamshi@linuxcent ~]$ ls -l redmine-4.0.6/bin/about 
-rwxrwxr-x. 1 vamshi vamshi 167 Dec 20 11:46 redmine-4.0.6/bin/about</pre>
<h3><b>How to Extract specific files or Directories from the archive<br />
</b></h3>
<pre>vamshi@LinuxCent:/tmp/linux-test&gt; tar -zxvf Linux-flavours.tar.gz Redhat-Distro/Centos/
Redhat-Distro/Centos/
Redhat-Distro/Centos/centos.txt
Redhat-Distro/Centos/CentOS-versions/
Redhat-Distro/Centos/CentOS-versions/centos7.txt
Redhat-Distro/Centos/CentOS-versions/centos5.5.txt
Redhat-Distro/Centos/CentOS-versions/centos6.9.txt
Redhat-Distro/Centos/CentOS-versions/centos5.8.txt
Redhat-Distro/Centos/CentOS-versions/centos6.1.txt
Redhat-Distro/Centos/README-CentOS</pre>
<p>&nbsp;</p>
<p>This way we are able to extract only the specific directories pertaining to Centos from Redhat-Distro.<br />
Now we would do the extraction of the contents on Redhat-Distro and its sub directories.<br />
Extracting Sub-directories inside the compressed tar.gz</p>
<h3><b>How to Extract TAR file Contents to a New directory?</b></h3>
<p>The tar program by default, extracts the archive contents to the present working directory.<br />
By specifying the option <code>--directory (-C)</code> You can extract archive files in a Target directory.</p>
<pre>vamshi.santhapuri@LinuxCent:/tmp/linux-test1&gt; tar -xzvf ~/Linux/jdk-8u101-linux-x64.tar.gz  -C /usr/local/</pre>
<p>The above operation extracts the java bundle to /usr/local/ directory.</p>
<h2>How to extract only the specific directory from the Compression to a Target directory?</h2>
<pre>vamshi.santhapuri@LinuxCent:/tmp/linux-test1&gt; tar -xzvf ~/Linux/Linux-flavours.tar.gz Redhat-Distro/RHEL-Versions/ -C /tmp/linux-test
Redhat-Distro/RHEL-Versions/
Redhat-Distro/RHEL-Versions/redhat5.txt
Redhat-Distro/RHEL-Versions/redhat7.txt
Redhat-Distro/RHEL-Versions/redhat6.txt
Redhat-Distro/RHEL-Versions/redhat8.txt</pre>
<h2><b>How to tar compress the specific Files and Directory and Sub-directories / Multiple Directories using tar command?<br />
</b></h2>
<p>Below is the Demonstration of compression program using gz compression.</p>
<pre>vamshi@LinuxCent:~/Linux&gt; tar -cvzf Redhat-Distro/ Linux-flavours.tar.gz centos.txt fedora.txt opensuse.txt redhat.txt ubuntu.txt
centos.txt
fedora.txt
opensuse.txt
redhat.txt
Redhat-Distro/centos.txt
Redhat-Distro/fedora.txt
Redhat-Distro/redhat.txt
Redhat-Distro/Redhat-Versions/
Redhat-Distro/Redhat-Versions/redhat5.txt
Redhat-Distro/Redhat-Versions/redhat7.txt
Redhat-Distro/Redhat-Versions/redhat6.txt
Redhat-Distro/Redhat-Versions/redhat8.txt</pre>
<p>You can also compress multiple directories and files into a single tar.gz file as demonstrated below</p>
<h2>How to exclude particular directories and file from the compression using tar command?</h2>
<p>We can make use of the <code>--exclude=&quot;DontIncludethisPath&quot;</code> in Linux tar command, where in the base directory of mentioned pattern are excluded.. Lets run the tar command and see the results</p>
<pre>vamshi@linuxCent:~/Linux/OSes&gt; tar -czvf exclude-flavours.tar.gz --exclude="Redhat-Distro" .
./
./OpenSuse-Distro/
./OpenSuse-Distro/README-Opensuse-Distro
./OpenSuse-Distro/opensuse.txt
./Debian-Distro/
./Debian-Distro/ubuntu.txt
./Debian-Distro/debian.txt
./Debian-Distro/README-Debian-Distro
tar: .: file changed as we read it
</pre>
<p>The compression successfully completed and now lets list out the files</p>
<pre>vamshi@linuxCent:~/Linux/OSes&gt; ls -lthr
total 16K
drwxr-xr-x 2 vamshi users 4.0K Apr  8 14:09 OpenSuse-Distro
drwxr-xr-x 2 vamshi users 4.0K Apr  8 14:09 Debian-Distro
drwxr-xr-x 5 vamshi users 4.0K Apr  8 14:09 Redhat-Distro
-rw-r--r-- 1 vamshi users  718 Apr 8 19:18 exclude-flavours.tar.gz</pre>
<p>From the dry-run extract output of the compression does not contain the Directory <code>Redhat-Distro</code></p>
<pre>vamshi@linuxCent:~/Linux/OSes&gt; tar -tvf exclude-flavours.tar.gz
drwxr-xr-x vamshi/users 0 2020-04-08 19:18 ./
drwxr-xr-x vamshi/users 0 2020-04-08 14:09 ./OpenSuse-Distro/
-rw-r--r-- vamshi/users 0 2020-04-08 14:09 ./OpenSuse-Distro/README-Opensuse-Distro
-rw-r--r-- vamshi/users 9 2020-04-08 13:22 ./OpenSuse-Distro/opensuse.txt
drwxr-xr-x vamshi/users 0 2020-04-08 14:09 ./Debian-Distro/
-rw-r--r-- vamshi/users 7 2020-04-08 13:22 ./Debian-Distro/ubuntu.txt
-rw-r--r-- vamshi/users 7 2020-04-08 13:50 ./Debian-Distro/debian.txt
-rw-r--r-- vamshi/users 0 2020-04-08 14:09 ./Debian-Distro/README-Debian-Distro</pre>
<p><strong>How do I open a tar file in Linux?</strong></p>
<p>tar Utility</p>
<ol>
<li>Let&#8217;s consider that we want to extract and open a doc file, and then we can use the below command to unzip the</li>
<li>file on Linux:</li>
<li>tar –xvzf doc.tar.gz. Remember that the tar. &#8230;</li>
<li>tar –cvzf docs.tar.gz ~/Documents. &#8230;</li>
<li>tar -cvf documents.tar ~/Documents. &#8230;</li>
<li>tar –xvf docs.tar. &#8230;</li>
<li>gzip xyz.txt. &#8230;</li>
<li>gunzip test.txt. &#8230;</li>
<li>gzip *.txt.</li>
</ol>
<h2>How do I view the contents of a tar file in Unix?</h2>
<p>tar File Content. Use -t switch with tar command to list content of a archive. tar file without actually extracting.</p>
<h2>How do I view a tar file?</h2>
<p><strong>How to open TAR files</strong></p>
<ul>
<li>Download and save the TAR file to your computer. &#8230;</li>
<li>Launch WinZip and open the compressed file by clicking File &gt; Open. &#8230;</li>
<li>Select all of the files in the compressed folder or select only the files you want to extract by holding the CTRL key and left-clicking on them.</li>
</ul>
<h2>Where can I find tar files in Linux?</h2>
<p>Combining find and tar commands so that we can find and tar files into a tarball</p>
<ol>
<li>-name &#8220;*. doc&#8221; : Find file as per given pattern/criteria. In this case find all *. doc files in $HOME.</li>
<li>-exec tar &#8230; : Execute tar command on all files found by the find command.</li>
</ol>
<h2>How do I extract a tar file?</h2>
<p>To extract (unzip) a tar. gz file simply right-click on the file you want to extract and select “Extract”. Windows users will need a tool named 7zip to extract tar.</p>
<h2>How do I unzip a tar file in Terminal?</h2>
<p>The most common uses of the tar command are to create and extract a tar archive. To extract an archive, use the tar -xf command followed by the archive name, and to create a new one use tar -czf followed by the archive name and the files and directories you want to add to the archive.</p>
<h2>How do I extract a tar file from a directory in Linux?</h2>
<p>Syntax For Tar Command To Extract Tar Files To a Different Directory</p>
<ol>
<li>x : Extract files.</li>
<li>f : Tar archive name.</li>
<li>&#8211;directory : Set directory name to extract files.</li>
<li>-C : Set dir name to extract files.</li>
<li>-z : Work on . tar. &#8230;</li>
<li>-j : Work on . tar. &#8230;</li>
<li>-J (capital J ) : Work on . tar. &#8230;</li>
<li>-v : Verbose output i.e. show progress on screen.</li>
</ol>
<h2>Can 7 Zip open tar files?</h2>
<p>7-Zip can also be used to unpack many other formats and to create tar files (amongst others). Download and install 7-Zip from 7-zip.org. &#8230; Move the tar file to the directory you wish to unpack into (usually the tar file will put everything into a directory inside this directory).</p>
<h2>What is tar file in Linux?</h2>
<p>The Linux &#8216;tar&#8217; stands for tape archive, is used to create Archive and extract the Archive files. tar command in Linux is one of the important command which provides archiving functionality in Linux. We can use Linux tar command to create compressed or uncompressed Archive files and also maintain and modify them.</p>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-access-tar-files-in-linux-unix%2F&amp;linkname=How%20to%20access%20Tar%20files%20in%20Linux%2FUnix" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-access-tar-files-in-linux-unix%2F&amp;linkname=How%20to%20access%20Tar%20files%20in%20Linux%2FUnix" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-access-tar-files-in-linux-unix%2F&amp;linkname=How%20to%20access%20Tar%20files%20in%20Linux%2FUnix" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-access-tar-files-in-linux-unix%2F&amp;linkname=How%20to%20access%20Tar%20files%20in%20Linux%2FUnix" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-access-tar-files-in-linux-unix%2F&amp;linkname=How%20to%20access%20Tar%20files%20in%20Linux%2FUnix" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-access-tar-files-in-linux-unix%2F&amp;linkname=How%20to%20access%20Tar%20files%20in%20Linux%2FUnix" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-access-tar-files-in-linux-unix%2F&amp;linkname=How%20to%20access%20Tar%20files%20in%20Linux%2FUnix" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Fhow-to-access-tar-files-in-linux-unix%2F&#038;title=How%20to%20access%20Tar%20files%20in%20Linux%2FUnix" data-a2a-url="https://linuxcent.com/how-to-access-tar-files-in-linux-unix/" data-a2a-title="How to access Tar files in Linux/Unix"></a></p><p>The post <a href="https://linuxcent.com/how-to-access-tar-files-in-linux-unix/">How to access Tar files in Linux/Unix</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/how-to-access-tar-files-in-linux-unix/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">106</post-id>	</item>
		<item>
		<title>Time and date setup in Linux systemd with timedatectl</title>
		<link>https://linuxcent.com/time-and-date-setup-in-linux-systemd-with-timedatectl/</link>
					<comments>https://linuxcent.com/time-and-date-setup-in-linux-systemd-with-timedatectl/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Fri, 03 Mar 2023 03:09:44 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://linuxcent.com/?p=394</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> &#60; 1</span> <span class="rt-label rt-postfix">minute</span></span>The Linux command is a systemd linux command that enables the Linux system admin to configure the date and time effectively. The is an important and a handy tool in linux to configure the time and date of the system, especially in a cluster setup where the synchronization is essential. [vamshi@node01 .ssh]$ sudo timedatectl Local ... <a title="Time and date setup in Linux systemd with timedatectl" class="read-more" href="https://linuxcent.com/time-and-date-setup-in-linux-systemd-with-timedatectl/" aria-label="Read more about Time and date setup in Linux systemd with timedatectl">Read more</a></p>
<p>The post <a href="https://linuxcent.com/time-and-date-setup-in-linux-systemd-with-timedatectl/">Time and date setup in Linux systemd with timedatectl</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> &lt; 1</span> <span class="rt-label rt-postfix">minute</span></span><p>The Linux command <code>timedatectl</code> is a systemd linux command that enables the Linux system admin to configure the date and time effectively.</p>
<p>The <code>timedatectl</code> is an important and a handy tool in linux to configure the time and date of the system, especially in a cluster setup where the synchronization is essential.</p>
<p>[vamshi@node01 .ssh]$ sudo timedatectl<br />
Local time: Wed 2020-04-01 13:53:03 UTC<br />
Universal time: Wed 2020-04-01 13:53:03 UTC<br />
RTC time: Sun 2020-04-26 14:26:09<br />
Time zone: UTC (UTC, +0000)<br />
NTP enabled: yes<br />
NTP synchronized: no<br />
RTC in local TZ: no<br />
DST active: n/a<br />
List the timezones from commandline</p>
<pre>[vamshi@node01 ~]$ sudo timedatectl list-timezones</pre>
<p>How to sync the server to with ntp time sync using timedatectl ?</p>
<p>You have to ensure that the ntp in installed and running and then automatically the time sync will be enforced with the following command.</p>
<p># sudo timedatectl set-ntp true</p>
<p>The manual time set can be performed using timedatectl as follows:</p>
<pre>[vamshi@node01 ~]$ sudo timedatectl set-time 17:53:03
[vamshi@node01 ~]$ date
Wed Apr 1 17:53:04 UTC 2020</pre>
<p>The best practice and practical approach is to set the timesync on with ntpd process enabled and in running state as show below:</p>
<pre># sudo systemctl enable ntpd --now</pre>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Ftime-and-date-setup-in-linux-systemd-with-timedatectl%2F&amp;linkname=Time%20and%20date%20setup%20in%20Linux%20systemd%20with%20timedatectl" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Ftime-and-date-setup-in-linux-systemd-with-timedatectl%2F&amp;linkname=Time%20and%20date%20setup%20in%20Linux%20systemd%20with%20timedatectl" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Ftime-and-date-setup-in-linux-systemd-with-timedatectl%2F&amp;linkname=Time%20and%20date%20setup%20in%20Linux%20systemd%20with%20timedatectl" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Ftime-and-date-setup-in-linux-systemd-with-timedatectl%2F&amp;linkname=Time%20and%20date%20setup%20in%20Linux%20systemd%20with%20timedatectl" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Ftime-and-date-setup-in-linux-systemd-with-timedatectl%2F&amp;linkname=Time%20and%20date%20setup%20in%20Linux%20systemd%20with%20timedatectl" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Ftime-and-date-setup-in-linux-systemd-with-timedatectl%2F&amp;linkname=Time%20and%20date%20setup%20in%20Linux%20systemd%20with%20timedatectl" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Ftime-and-date-setup-in-linux-systemd-with-timedatectl%2F&amp;linkname=Time%20and%20date%20setup%20in%20Linux%20systemd%20with%20timedatectl" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Ftime-and-date-setup-in-linux-systemd-with-timedatectl%2F&#038;title=Time%20and%20date%20setup%20in%20Linux%20systemd%20with%20timedatectl" data-a2a-url="https://linuxcent.com/time-and-date-setup-in-linux-systemd-with-timedatectl/" data-a2a-title="Time and date setup in Linux systemd with timedatectl"></a></p><p>The post <a href="https://linuxcent.com/time-and-date-setup-in-linux-systemd-with-timedatectl/">Time and date setup in Linux systemd with timedatectl</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/time-and-date-setup-in-linux-systemd-with-timedatectl/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">394</post-id>	</item>
		<item>
		<title>Buildah &#8211; An alternate Docker build tool</title>
		<link>https://linuxcent.com/buildah-an-alternate-docker-build-tool/</link>
					<comments>https://linuxcent.com/buildah-an-alternate-docker-build-tool/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Fri, 03 Mar 2023 00:54:30 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://linuxcent.com/?p=481</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> &#60; 1</span> <span class="rt-label rt-postfix">minute</span></span>What is Buildah? Is it a better Docker alternate? Used to build container images as per OCI(Open Container Initiative) standard which provides API to build Images in docker format using golang. The project provides a command line tool that be used to create an OCI or traditional Docker image format image and to then build ... <a title="Buildah &#8211; An alternate Docker build tool" class="read-more" href="https://linuxcent.com/buildah-an-alternate-docker-build-tool/" aria-label="Read more about Buildah &#8211; An alternate Docker build tool">Read more</a></p>
<p>The post <a href="https://linuxcent.com/buildah-an-alternate-docker-build-tool/">Buildah &#8211; An alternate Docker build tool</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> &lt; 1</span> <span class="rt-label rt-postfix">minute</span></span><h2 class="western" align="left">What is Buildah? Is it a better Docker alternate?</h2>
<p>Used to build container images as per OCI<u>(Open Container Initiative</u>) standard which provides API to build Images in docker format using golang.</p>
<blockquote class="western"><p>The <code>Buildah</code> project provides a command line tool that be used to create an OCI or traditional Docker image format image and to then build a working container from the image. The container can be mounted and modified and then an image can be saved based on the updated container.</p></blockquote>
<p><code>Podman</code> – Used to manage the pulling, tagging the images similar to Docker based on OCI standard.<br />
To be used for Production grade deployments. It also allows you to create, run, and maintain containers created from those images.</p>
<h2><b>Buildah Concepts:</b></h2>
<ul>
<li>Buildah&#8217;s commands replicate all of the commands that are found in a Dockerfile.</li>
<li>Also has the feasibility to build docker images with Dockerfile while not requiring root privileges while providing lowerlevel coreutils interface to build images</li>
<li>Buildah uses simple fork-exec model and does not run as a daemon but it is based on a comprehensive API in golang.</li>
<li>Buildah uses <code>runc</code>run commands when <code>buildah run</code> used, or when <code>buildah build-using-dockerfile</code> encounters a <code>RUN</code> instruction. And it is namespace dependent on the Host System</li>
</ul>
<ul>
<li>Buildah relies on the CNI library and plugins to set up interfaces and routing for network namespaces</li>
<li>Buildah on Red Hat Enterprise Linux or CentOS, version 7.4 or higher is required. On other Linux distributions Buildah requires a kernel version of 4.0 or higher in order to support the OverlayFS filesystem &#8211; <a href="https://github.com/containers/buildah/blob/master/install.md">https://github.com/containers/buildah/blob/master/install.md</a></li>
<li>The dependencies required as btree filesystem, <code>containernetworking-cni</code>, <code>golang</code> and <code>bz2</code> and other common-container tools.</li>
</ul>
<p>Buildah Configuration Files and its Directory Structure:</p>
<ol>
<li style="list-style-type: none;"></li>
</ol>
<p># /usr/share/containers/</p>
<p># registries.conf<br />
# mounts.conf<br />
# seccomp.json<br />
# policy.json</p>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Fbuildah-an-alternate-docker-build-tool%2F&amp;linkname=Buildah%20%E2%80%93%20An%20alternate%20Docker%20build%20tool" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Fbuildah-an-alternate-docker-build-tool%2F&amp;linkname=Buildah%20%E2%80%93%20An%20alternate%20Docker%20build%20tool" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Fbuildah-an-alternate-docker-build-tool%2F&amp;linkname=Buildah%20%E2%80%93%20An%20alternate%20Docker%20build%20tool" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Fbuildah-an-alternate-docker-build-tool%2F&amp;linkname=Buildah%20%E2%80%93%20An%20alternate%20Docker%20build%20tool" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Fbuildah-an-alternate-docker-build-tool%2F&amp;linkname=Buildah%20%E2%80%93%20An%20alternate%20Docker%20build%20tool" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Fbuildah-an-alternate-docker-build-tool%2F&amp;linkname=Buildah%20%E2%80%93%20An%20alternate%20Docker%20build%20tool" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Fbuildah-an-alternate-docker-build-tool%2F&amp;linkname=Buildah%20%E2%80%93%20An%20alternate%20Docker%20build%20tool" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Fbuildah-an-alternate-docker-build-tool%2F&#038;title=Buildah%20%E2%80%93%20An%20alternate%20Docker%20build%20tool" data-a2a-url="https://linuxcent.com/buildah-an-alternate-docker-build-tool/" data-a2a-title="Buildah – An alternate Docker build tool"></a></p><p>The post <a href="https://linuxcent.com/buildah-an-alternate-docker-build-tool/">Buildah &#8211; An alternate Docker build tool</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/buildah-an-alternate-docker-build-tool/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">481</post-id>	</item>
		<item>
		<title>How to login and connect to docker container tty with a username</title>
		<link>https://linuxcent.com/how-to-connect-to-docker-container-tty-with-a-username/</link>
					<comments>https://linuxcent.com/how-to-connect-to-docker-container-tty-with-a-username/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Thu, 02 Mar 2023 22:07:51 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://linuxcent.com/?p=520</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> &#60; 1</span> <span class="rt-label rt-postfix">minute</span></span>How to login to the docker through commandline? The docker is similar to running a tty on a linux machine. the only difference is it can accept many more exec connections, Although you can enable ssh to the docker but it will only be possible while running an openssh server inside the running container. You ... <a title="How to login and connect to docker container tty with a username" class="read-more" href="https://linuxcent.com/how-to-connect-to-docker-container-tty-with-a-username/" aria-label="Read more about How to login and connect to docker container tty with a username">Read more</a></p>
<p>The post <a href="https://linuxcent.com/how-to-connect-to-docker-container-tty-with-a-username/">How to login and connect to docker container tty with a username</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> &lt; 1</span> <span class="rt-label rt-postfix">minute</span></span><h2>How to login to the docker through commandline?</h2>
<p>The docker <code>exec</code> is similar to running a tty on a linux machine. the only difference is it can accept many more exec connections, Although you can enable ssh to the docker but it will only be possible while running an openssh server inside the running container.</p>
<p>You can exec to connect to a running container much like the ssh into the running machine, Here we use the special options <code>-i</code> or <code>--interactive</code> to provide interaction and <code>-t</code> or <code>--tty</code> which allocates a <code>pseudo tty</code> terminal of the type of shell that is followed<br />
The syntax of docker exec is as below:</p>
<pre>docker exec -it &lt;container-id | container-name&gt; bash</pre>
<pre>[vamshi@node01 ~]$ docker exec -it b511234ebe31 bash
jenkins@b511234ebe31:/$ id
uid=1000(jenkins) gid=1000(jenkins) groups=1000(jenkins)
</pre>
<p>We know that the docker exec command is used opens up a tty terminal to connect to the running docker container, but It will connect us with the Default USER that was activated during it docker build.</p>
<p>We can use the <code>-u</code> flag to connect to the container with the username that is enabled for that image, We see the below example</p>
<pre>[vamshi@node01 ~]# docker exec -it  -u root b511234ebe31 bash
root@b511234ebe31:/# pwd
/
root@b511234ebe31:/# id
uid=0(root) gid=0(root) groups=0(root)</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-connect-to-docker-container-tty-with-a-username%2F&amp;linkname=How%20to%20login%20and%20connect%20to%20docker%20container%20tty%20with%20a%20username" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-connect-to-docker-container-tty-with-a-username%2F&amp;linkname=How%20to%20login%20and%20connect%20to%20docker%20container%20tty%20with%20a%20username" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-connect-to-docker-container-tty-with-a-username%2F&amp;linkname=How%20to%20login%20and%20connect%20to%20docker%20container%20tty%20with%20a%20username" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-connect-to-docker-container-tty-with-a-username%2F&amp;linkname=How%20to%20login%20and%20connect%20to%20docker%20container%20tty%20with%20a%20username" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-connect-to-docker-container-tty-with-a-username%2F&amp;linkname=How%20to%20login%20and%20connect%20to%20docker%20container%20tty%20with%20a%20username" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-connect-to-docker-container-tty-with-a-username%2F&amp;linkname=How%20to%20login%20and%20connect%20to%20docker%20container%20tty%20with%20a%20username" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-connect-to-docker-container-tty-with-a-username%2F&amp;linkname=How%20to%20login%20and%20connect%20to%20docker%20container%20tty%20with%20a%20username" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Fhow-to-connect-to-docker-container-tty-with-a-username%2F&#038;title=How%20to%20login%20and%20connect%20to%20docker%20container%20tty%20with%20a%20username" data-a2a-url="https://linuxcent.com/how-to-connect-to-docker-container-tty-with-a-username/" data-a2a-title="How to login and connect to docker container tty with a username"></a></p><p>The post <a href="https://linuxcent.com/how-to-connect-to-docker-container-tty-with-a-username/">How to login and connect to docker container tty with a username</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/how-to-connect-to-docker-container-tty-with-a-username/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">520</post-id>	</item>
		<item>
		<title>How to allocate resources to docker images in Runtime?</title>
		<link>https://linuxcent.com/how-to-allocate-resources-to-docker-images-in-runtime/</link>
					<comments>https://linuxcent.com/how-to-allocate-resources-to-docker-images-in-runtime/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Thu, 02 Mar 2023 21:27:51 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://linuxcent.com/?p=522</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> &#60; 1</span> <span class="rt-label rt-postfix">minute</span></span>We have seen the docker runtime environment takes up the overall available system resources on the system and tends to impact the base system. To better utilize the containers, we can avail the resource cap and define the metric limits on specific containers while starting up the respective docker images.. The general syntax goes as ... <a title="How to allocate resources to docker images in Runtime?" class="read-more" href="https://linuxcent.com/how-to-allocate-resources-to-docker-images-in-runtime/" aria-label="Read more about How to allocate resources to docker images in Runtime?">Read more</a></p>
<p>The post <a href="https://linuxcent.com/how-to-allocate-resources-to-docker-images-in-runtime/">How to allocate resources to docker images in Runtime?</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> &lt; 1</span> <span class="rt-label rt-postfix">minute</span></span><p>We have seen the docker runtime environment takes up the overall available system resources on the system and tends to impact the base system.</p>
<p>To better utilize the containers, we can avail the resource cap and define the metric limits on specific containers while starting up the respective docker images..</p>
<p>The general syntax goes as follows:</p>
<pre># docker run --cpus ="x.x" --memory=x[M|G] docker-image</pre>
<p>Here we see the demonstration</p>
<pre>[root@node01 ~]# docker run --cpus="0.2" --memory="200M" jenkins:latest</pre>
<pre>/usr/bin/docker-current: Error response from daemon: Minimum memory limit allowed is 4MB.</pre>
<p>It should be noticed that the minimum Memory limit allowed for the docker container to run is 4MB and the minimum CPU cores is at 0.01, any thing lower that this means the container runtime fails to allocate sufficient resources. These limits will be efficient when running on some test and debug scenarios.</p>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-allocate-resources-to-docker-images-in-runtime%2F&amp;linkname=How%20to%20allocate%20resources%20to%20docker%20images%20in%20Runtime%3F" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-allocate-resources-to-docker-images-in-runtime%2F&amp;linkname=How%20to%20allocate%20resources%20to%20docker%20images%20in%20Runtime%3F" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-allocate-resources-to-docker-images-in-runtime%2F&amp;linkname=How%20to%20allocate%20resources%20to%20docker%20images%20in%20Runtime%3F" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-allocate-resources-to-docker-images-in-runtime%2F&amp;linkname=How%20to%20allocate%20resources%20to%20docker%20images%20in%20Runtime%3F" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-allocate-resources-to-docker-images-in-runtime%2F&amp;linkname=How%20to%20allocate%20resources%20to%20docker%20images%20in%20Runtime%3F" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-allocate-resources-to-docker-images-in-runtime%2F&amp;linkname=How%20to%20allocate%20resources%20to%20docker%20images%20in%20Runtime%3F" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-allocate-resources-to-docker-images-in-runtime%2F&amp;linkname=How%20to%20allocate%20resources%20to%20docker%20images%20in%20Runtime%3F" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Fhow-to-allocate-resources-to-docker-images-in-runtime%2F&#038;title=How%20to%20allocate%20resources%20to%20docker%20images%20in%20Runtime%3F" data-a2a-url="https://linuxcent.com/how-to-allocate-resources-to-docker-images-in-runtime/" data-a2a-title="How to allocate resources to docker images in Runtime?"></a></p><p>The post <a href="https://linuxcent.com/how-to-allocate-resources-to-docker-images-in-runtime/">How to allocate resources to docker images in Runtime?</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/how-to-allocate-resources-to-docker-images-in-runtime/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">522</post-id>	</item>
		<item>
		<title>How to make a file or Folder undeletable on Linux</title>
		<link>https://linuxcent.com/how-to-make-a-file-or-folder-undeletable-on-linux/</link>
					<comments>https://linuxcent.com/how-to-make-a-file-or-folder-undeletable-on-linux/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Wed, 01 Mar 2023 17:05:42 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://linuxcent.com/?p=126</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 2</span> <span class="rt-label rt-postfix">minutes</span></span>How to make a file or Folder/Directory un-deletable on Linux? The linux operating as we know if famous for the phrase &#8220;Everything is a file&#8221;, In such circumstances it is interesting to explore the possibilities of making a file undeletable, even by the owner of the file and for that matter even the root user, ... <a title="How to make a file or Folder undeletable on Linux" class="read-more" href="https://linuxcent.com/how-to-make-a-file-or-folder-undeletable-on-linux/" aria-label="Read more about How to make a file or Folder undeletable on Linux">Read more</a></p>
<p>The post <a href="https://linuxcent.com/how-to-make-a-file-or-folder-undeletable-on-linux/">How to make a file or Folder undeletable on Linux</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 2</span> <span class="rt-label rt-postfix">minutes</span></span><h2>How to make a file or Folder/Directory un-deletable on Linux?</h2>
<p>The linux operating as we know if famous for the phrase &#8220;Everything is a file&#8221;, In such circumstances it is interesting to explore the possibilities of making a file undeletable, even by the owner of the file and for that matter even the root user, In the Linux Ecosystem the root is the poweruser.</p>
<p>This section we will see the potential of such feature.</p>
<p>As we have already seen the section on deleting files on Linux (removing the files in Linux).</p>
<p>We will now demonstrate the power of Linux where you can restrict the deletion of a file on Linux.</p>
<p>Linux offers a <code>chattr</code> commandline utility which generally modifies the file attributes as the name suggests, but the practical use is to make a file undeletable.</p>
<p>Sample command syntax:</p>
<pre>[vamshi@linuxcent ~]$ chattr +i &lt;samplefile&gt;</pre>
<pre>vamshi@linuxcent delete-dir]$ sudo chattr +i samplefile2.txt</pre>
<pre>Now we do ls -l samplefile2.txt</pre>
<pre>[vamshi@linuxcent ~]$ sudo chattr +i samplefile2.txt
[vamshi@linuxcent ~]$ ls -l samplefile2.txt
-rw-rw-r--. 1 vamshi vamshi 4 Apr 8 15:42 samplefile2.txt</pre>
<p>Now we shall try to write some content to this file and see no change in the basic file permissions(see changing ownership of files).</p>
<pre>[vamshi@linuxcent delete-dir]$ echo "New content" &gt; samplefile2.txt
-bash: samplefile2.txt: Permission denied</pre>
<h2>Deleting file forcefully with the <code>--force</code> option ?</h2>
<pre>[vamshi@linuxcent delete-dir]$ sudo /bin/rm -f samplefile2.txt

/bin/rm: cannot remove ‘samplefile2.txt’: Operation not permitted</pre>
<p>Linux command <code>lsattr</code> offers the ability to view the permissions set by the <code>chattr</code> command.<br />
The current File attributes can be listed using <code>lsattr</code> followed by the filename [/code]samplefile2.txt[/code] as below</p>
<pre>[vamshi@linuxcent delete-dir]$ lsattr samplefile2.txt
----i----------- samplefile2.txt</pre>
<p>Even the root user on the host is unable to delete the file or modify its contents.</p>
<p>The file can be deleted only when the attributes are unset, It is demonstrated as follows:</p>
<pre>[vamshi@linuxcent delete-dir]$ sudo chattr -i samplefile2.txt
[vamshi@linuxcent delete-dir]$ lsattr samplefile2.txt
---------------- samplefile2.txt</pre>
<p>As we can see the <code>lsattr</code> doesn&#8217;t hold true anymore attributes on our file <code>samplefile2.txt</code> and is now being treated as any other normal file with basic file attributes.<br />
The <code>-</code> operation removes the special linux file attributes on the mentioned file.</p>
<p>The <code>chattr / lsattr</code> linux commandline utilities currently supports the popular filesystems such as ext3,ext4,xfs, btrfs etc,.</p>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-make-a-file-or-folder-undeletable-on-linux%2F&amp;linkname=How%20to%20make%20a%20file%20or%20Folder%20undeletable%20on%20Linux" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-make-a-file-or-folder-undeletable-on-linux%2F&amp;linkname=How%20to%20make%20a%20file%20or%20Folder%20undeletable%20on%20Linux" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-make-a-file-or-folder-undeletable-on-linux%2F&amp;linkname=How%20to%20make%20a%20file%20or%20Folder%20undeletable%20on%20Linux" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-make-a-file-or-folder-undeletable-on-linux%2F&amp;linkname=How%20to%20make%20a%20file%20or%20Folder%20undeletable%20on%20Linux" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-make-a-file-or-folder-undeletable-on-linux%2F&amp;linkname=How%20to%20make%20a%20file%20or%20Folder%20undeletable%20on%20Linux" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-make-a-file-or-folder-undeletable-on-linux%2F&amp;linkname=How%20to%20make%20a%20file%20or%20Folder%20undeletable%20on%20Linux" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-make-a-file-or-folder-undeletable-on-linux%2F&amp;linkname=How%20to%20make%20a%20file%20or%20Folder%20undeletable%20on%20Linux" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Fhow-to-make-a-file-or-folder-undeletable-on-linux%2F&#038;title=How%20to%20make%20a%20file%20or%20Folder%20undeletable%20on%20Linux" data-a2a-url="https://linuxcent.com/how-to-make-a-file-or-folder-undeletable-on-linux/" data-a2a-title="How to make a file or Folder undeletable on Linux"></a></p><p>The post <a href="https://linuxcent.com/how-to-make-a-file-or-folder-undeletable-on-linux/">How to make a file or Folder undeletable on Linux</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/how-to-make-a-file-or-folder-undeletable-on-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">126</post-id>	</item>
		<item>
		<title>How to create symbolic Link or Softlinks in Linux and differentiate between Softlink vs Hardlink</title>
		<link>https://linuxcent.com/how-to-create-symbolic-link-or-softlinks-in-linux-and-differentiate-between-softlink-vs-hardlink/</link>
					<comments>https://linuxcent.com/how-to-create-symbolic-link-or-softlinks-in-linux-and-differentiate-between-softlink-vs-hardlink/#respond</comments>
		
		<dc:creator><![CDATA[Vamshi Krishna Santhapuri]]></dc:creator>
		<pubDate>Wed, 01 Mar 2023 08:24:42 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://linuxcent.com/?p=99</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 4</span> <span class="rt-label rt-postfix">minutes</span></span>The concept of Links in Linux/Unix based systems is Unique and gives a very deeper understanding of the Linux working internals at various levels. The symbolic also known as Soft link is a special type of linking that acts as a pointer to the original file present on the disk. The Softlink span across different ... <a title="How to create symbolic Link or Softlinks in Linux and differentiate between Softlink vs Hardlink" class="read-more" href="https://linuxcent.com/how-to-create-symbolic-link-or-softlinks-in-linux-and-differentiate-between-softlink-vs-hardlink/" aria-label="Read more about How to create symbolic Link or Softlinks in Linux and differentiate between Softlink vs Hardlink">Read more</a></p>
<p>The post <a href="https://linuxcent.com/how-to-create-symbolic-link-or-softlinks-in-linux-and-differentiate-between-softlink-vs-hardlink/">How to create symbolic Link or Softlinks in Linux and differentiate between Softlink vs Hardlink</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 4</span> <span class="rt-label rt-postfix">minutes</span></span><p>The concept of Links in Linux/Unix based systems is Unique and gives a very deeper understanding of the Linux working internals at various levels.</p>
<p>The symbolic also known as Soft link is a special type of linking that acts as a pointer to the original file present on the disk.</p>
<p>The Softlink span across different filesystems extensively and widely used during software package installation and configuring</p>
<p>Lets look at the example of java command linking:</p>
<pre>[root@node02 ]# which java
/bin/java
[root@linuxcent ]# ls -l /bin/java
lrwxrwxrwx. 1 root root 22 Apr 10 11:52 /bin/java -&gt; /etc/alternatives/java
[root@node02 boot]# ls -l /etc/alternatives/java
lrwxrwxrwx. 1 root root 73 Apr 10 11:52 /etc/alternatives/java -&gt; /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64/jre/bin/java
[root@linuxcent ]#</pre>
<p>If you upgrade java on your system then the <code>/bin/java</code> command points out to a newer installed version of <code>/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.242.b08-0.el7_7.x86_64/jre/bin/java </code></p>
<p>We will see the demonstration of a Symbolic link.</p>
<p>In Linux to make the links between files, the command-line utility is “ln”.</p>
<p>Softlink Creation syntax using the Linux command line utility ln <code>-s</code> option:</p>
<pre>ln -s &lt;source file|Directory &gt; &lt;destination Link file|Directory&gt;</pre>
<p>Below is an example</p>
<pre>[vamshi@linuxcent html]$ ln -sf /var/www/html/index.html /tmp/index.html

[vamshi@linuxcent html]$ ls -l /tmp/index.html

lrwxrwxrwx. 1 vamshi vamshi 24 Apr  1 18:23 /tmp/index.html -&gt; /var/www/html/index.html</pre>
<p>&nbsp;</p>
<p>The second file is called a symbolic ink to <code>/tmp/index.html</code></p>
<p>Now the second file <code>/tmp/index.html</code> is called a Symbolic link to the First file on the disk <code>/var/www/html/index.html</code></p>
<p>It means that the second file is just pointing to the first file’s location on disk without actually copying the contents of the file.</p>
<pre>[vamshi@linuxcent html]$ cat /var/www/html/index.html
Welcome to LinuxCent.com
[vamshi@linuxcent html]$ cat /tmp/index.html
Welcome to LinuxCent.com

</pre>
<p>When you edit either of the file, the contents of the original file on disk are directly modified.</p>
<p>&nbsp;</p>
<p>How to create Softlinks to Directories in Linux ?<br />
The same logic applies to creating the soft links to directories, Lets see the Demonstration below:</p>
<pre>[vamshi@linuxcent html]$  ln -sf /var/www/html/linuxcent/static/ /tmp/static</pre>
<pre>[vamshi@linuxcent html]$ ls -l /tmp/static
lrwxrwxrwx. 1 vamshi vamshi 32 Apr  8 18:37 /tmp/static -&gt; /var/www/html/linuxcent/static/


</pre>
<p>&nbsp;</p>
<p>How do we Remove the linking between the files is even simpler.</p>
<p>Simply run the <code>unlink </code> command on its Destination:</p>
<p>Sample command:</p>
<pre>unlink &lt;destination Link file | Directory&gt;</pre>
<p>Lets see the Demonstration</p>
<pre>unlink /tmp/data-dir</pre>
<p>&nbsp;</p>
<h2>Understanding Symbolic / Hard link concept better with improving knowledge on Inode.</h2>
<p>To better understand the concept of Symbolic linking we need to understand the concept of Inode numbers present in Linux. I will give a brief overview of it in this section But for Detailed Review, Please see the What is Inode in Linux Section.</p>
<p>We can list out the inode number of any file on linux system using [/code]ls -i &lt;filename&gt;[/code]</p>
<p>Now The extreme left column indicates the system wide unique inode number:</p>
<pre>[root@node02 ~]# ls -li /var/www/html/index.html /tmp/index.html 
67290702 lrwxrwxrwx. 1 root root 24 Apr 8 19:09 /tmp/index.html -&gt; /var/www/html/index.html
33557754 -rw-r--r--. 1 root root 25 Apr 8 18:19 /var/www/html/index.html</pre>
<p>We can see here the inode number for both the files have different, Because the second file is just a pointer to the original source file..</p>
<h2>So why do we create the Symbolic Links ?</h2>
<p>We have the advantages of the Softlinks</p>
<ol>
<li>One Advantage of Softlinks/symbolic links is they span across different filesystems</li>
<li>Can have many softlinks to a single file/Directory.</li>
<li>Can create Symbolic Links of Directories and Files respectively.</li>
<li>Rsync program by default preserves the symbolic links.</li>
<li>The softlinks become activated immediately if the source is recreated or recovered after any kinds of network outages.</li>
</ol>
<h2>What are the best practices when using Softlinks ?</h2>
<p>The best practice while creating softlinks is to mention absolute path for source and destination links.</p>
<p>On the other hand you should also understand the disadvantages or shortcomings.</p>
<ol>
<li>It is Important to observe that If the source file is deleted then the symbolic link becomes useless.</li>
<li>Incases of the Network filesystem issues leading to unavailability of softlinks.</li>
</ol>
<p>It is also Essential to understand about the Hardlinks to get an overall understanding.</p>
<p>&nbsp;</p>
<p>Creating a hard link is a simple operation using <code>ln</code> command with no options</p>
<p>Sample Command:</p>
<pre>$ ln /path/to/source/ /path/to/HardLink/</pre>
<p>So lets start of by creating a hard link of our file <code>/var/www/html/index.html</code></p>
<pre>[vamshi@linuxcent linuxcent]$ ln /var/www/html/index.html /tmp/index-hl.html</pre>
<p>The command <code>ls -il</code> lists the inode number of the files.</p>
<pre>[vamshi@linuxcent  ]$ ls -i
33557752 index-hl.html  33557752 index.html</pre>
<p>So to conclude, The hard linking results in the same inode number, howmany ever times the hardlink of same file is created.<br />
The data continues to persists in the same storage location on the filesystem even if one of the hardlink file is deleted.<br />
As long as the inode number is identical on the files, no filename change matters to the filesystem.<br />
There will be no change in Hardlink behaviour.</p>
<p>Let&#8217;s add some content to the hardlink file here and see the Demonstration</p>
<pre>[vamshi@linuxcent ]$ echo "<code>We are updating the file to check out the Hardlinks</code>" &gt;&gt;  /tmp/index-hl.html</pre>
<code>We are updating the file to check out the Hardlinks</code>
<p>The new line is added in the original file.</p>
<pre>[vamshi@linuxcent linuxcent]$ cat index.html
Welcome to LinuxCent.com
We are updating the file to check out the Hardlinks</pre>
<p>Content manipulations to either of the files will be treated as a same file.</p>
<h2>How to Identify how many times a particular file was linked ?</h2>
<p>Note that Linux Command <code>ls -li</code> provides the actual link aggregate count information in the fourth column represented by the number <code>2</code> here, which means that it has a second hardlink reference and both the files are interchangeable.<br />
And It should be noted that a file has a link count of <code>1</code> by default as it references itself</p>
<pre>$ls -li
33557752 -rw-rw-r--. 2 vamshi vamshi 59 Apr  8 19:48 index-hl.html
33557752 -rw-rw-r--. 2 vamshi vamshi 59 Apr  8 19:48 index.html</pre>
<p>In case either one of the file is deleted, the other file survives and continues to function properly.</p>
<p>Lets see some hard facts on the Hardlinks.</p>
<ol>
<li>Hardlinks can&#8217;t be created to Directories.</li>
<li>They do not span across filesystems.</li>
</ol>
<p><a class="a2a_button_mastodon" href="https://www.addtoany.com/add_to/mastodon?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-create-symbolic-link-or-softlinks-in-linux-and-differentiate-between-softlink-vs-hardlink%2F&amp;linkname=How%20to%20create%20symbolic%20Link%20or%20Softlinks%20in%20Linux%20and%20differentiate%20between%20Softlink%20vs%20Hardlink" title="Mastodon" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_email" href="https://www.addtoany.com/add_to/email?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-create-symbolic-link-or-softlinks-in-linux-and-differentiate-between-softlink-vs-hardlink%2F&amp;linkname=How%20to%20create%20symbolic%20Link%20or%20Softlinks%20in%20Linux%20and%20differentiate%20between%20Softlink%20vs%20Hardlink" title="Email" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-create-symbolic-link-or-softlinks-in-linux-and-differentiate-between-softlink-vs-hardlink%2F&amp;linkname=How%20to%20create%20symbolic%20Link%20or%20Softlinks%20in%20Linux%20and%20differentiate%20between%20Softlink%20vs%20Hardlink" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-create-symbolic-link-or-softlinks-in-linux-and-differentiate-between-softlink-vs-hardlink%2F&amp;linkname=How%20to%20create%20symbolic%20Link%20or%20Softlinks%20in%20Linux%20and%20differentiate%20between%20Softlink%20vs%20Hardlink" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_x" href="https://www.addtoany.com/add_to/x?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-create-symbolic-link-or-softlinks-in-linux-and-differentiate-between-softlink-vs-hardlink%2F&amp;linkname=How%20to%20create%20symbolic%20Link%20or%20Softlinks%20in%20Linux%20and%20differentiate%20between%20Softlink%20vs%20Hardlink" title="X" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-create-symbolic-link-or-softlinks-in-linux-and-differentiate-between-softlink-vs-hardlink%2F&amp;linkname=How%20to%20create%20symbolic%20Link%20or%20Softlinks%20in%20Linux%20and%20differentiate%20between%20Softlink%20vs%20Hardlink" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_copy_link" href="https://www.addtoany.com/add_to/copy_link?linkurl=https%3A%2F%2Flinuxcent.com%2Fhow-to-create-symbolic-link-or-softlinks-in-linux-and-differentiate-between-softlink-vs-hardlink%2F&amp;linkname=How%20to%20create%20symbolic%20Link%20or%20Softlinks%20in%20Linux%20and%20differentiate%20between%20Softlink%20vs%20Hardlink" title="Copy Link" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Flinuxcent.com%2Fhow-to-create-symbolic-link-or-softlinks-in-linux-and-differentiate-between-softlink-vs-hardlink%2F&#038;title=How%20to%20create%20symbolic%20Link%20or%20Softlinks%20in%20Linux%20and%20differentiate%20between%20Softlink%20vs%20Hardlink" data-a2a-url="https://linuxcent.com/how-to-create-symbolic-link-or-softlinks-in-linux-and-differentiate-between-softlink-vs-hardlink/" data-a2a-title="How to create symbolic Link or Softlinks in Linux and differentiate between Softlink vs Hardlink"></a></p><p>The post <a href="https://linuxcent.com/how-to-create-symbolic-link-or-softlinks-in-linux-and-differentiate-between-softlink-vs-hardlink/">How to create symbolic Link or Softlinks in Linux and differentiate between Softlink vs Hardlink</a> appeared first on <a href="https://linuxcent.com">Linuxcent</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://linuxcent.com/how-to-create-symbolic-link-or-softlinks-in-linux-and-differentiate-between-softlink-vs-hardlink/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">99</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 

Served from: linuxcent.com @ 2026-04-23 23:53:01 by W3 Total Cache
-->