<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Khuram Murad</title>
    <description>The latest articles on DEV Community by Khuram Murad (@khurammurad).</description>
    <link>https://dev.to/khurammurad</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1703103%2Ff63f2e6a-b62f-405e-8d8b-cd086c10ecd8.png</url>
      <title>DEV Community: Khuram Murad</title>
      <link>https://dev.to/khurammurad</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/khurammurad"/>
    <language>en</language>
    <item>
      <title>How I Fixed ‘No NIC Except Loopback’ on CentOS Stream Minimal in VMware</title>
      <dc:creator>Khuram Murad</dc:creator>
      <pubDate>Mon, 21 Jul 2025 17:59:53 +0000</pubDate>
      <link>https://dev.to/khurammurad/how-i-fixed-no-nic-except-loopback-on-centos-stream-minimal-in-vmware-1cg5</link>
      <guid>https://dev.to/khurammurad/how-i-fixed-no-nic-except-loopback-on-centos-stream-minimal-in-vmware-1cg5</guid>
      <description>&lt;p&gt;I recently spun up a &lt;strong&gt;CentOS Stream 10 Minimal&lt;/strong&gt; VM in VMware to test some networked services. After installation, I ran:&lt;/p&gt;

&lt;p&gt;ip link show&lt;/p&gt;

&lt;p&gt;And saw &lt;strong&gt;only&lt;/strong&gt; the loopback device:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;1: lo: &amp;lt;LOOPBACK,UP,LOWER_UP&amp;gt; mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No &lt;code&gt;eth0&lt;/code&gt;, no &lt;code&gt;ens33&lt;/code&gt;, nothing but &lt;code&gt;lo&lt;/code&gt;. A quick check revealed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lspci | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; eth
&lt;span class="c"&gt;# → 02:00.0 Ethernet controller: Advanced Micro Devices, Inc. [AMD] 79C97x (PCnet32 LANCE)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;CentOS Stream Minimal didn’t load a driver for the VMware PCnet‑PCI II adapter, and my bridged LAN had &lt;strong&gt;no DHCP server&lt;/strong&gt;, so even a loaded driver wouldn’t help.&lt;/p&gt;

&lt;p&gt;Here’s a concise “restore‑your‑VM‑network” recipe—drop it into your personal wiki or a Gist and never get stuck without a NIC again 🤓.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Symptom
&lt;/h2&gt;

&lt;p&gt;Inside the VM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip &lt;span class="nb"&gt;link &lt;/span&gt;show
&lt;span class="c"&gt;# only shows 'lo'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lspci | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; eth
&lt;span class="c"&gt;# shows the AMD PCnet32 LANCE adapter&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No real interface (&lt;code&gt;eth0&lt;/code&gt;, &lt;code&gt;ens*&lt;/code&gt;, etc.) is ever created.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Root Cause
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Legacy NIC&lt;/strong&gt;
VMware’s default PCnet‑PCI II (&lt;code&gt;pcnet32&lt;/code&gt;) adapter isn’t supported out‑of‑the‑box by CentOS Stream Minimal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No DHCP&lt;/strong&gt;
In Bridged mode on a network without DHCP, the interface can’t acquire an IP—even if the driver loads.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  3. The Fix
&lt;/h2&gt;

&lt;h3&gt;
  
  
  A. Switch to NAT (Built‑in DHCP)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Power off&lt;/strong&gt; the VM.&lt;/li&gt;
&lt;li&gt;In VMware: &lt;strong&gt;VM → Settings → Network Adapter&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;NAT&lt;/strong&gt; instead of &lt;strong&gt;Bridged&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;✔ Enable &lt;strong&gt;Connected&lt;/strong&gt; and &lt;strong&gt;Connect at power on&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OK&lt;/strong&gt;, then &lt;strong&gt;power on&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;NAT mode uses VMware’s &lt;code&gt;vmnet8&lt;/code&gt; network and has a built‑in DHCP server, so you’ll always get a lease.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  B. Verify the Guest Sees a NIC
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ip &lt;span class="nb"&gt;link &lt;/span&gt;show
&lt;span class="c"&gt;# 1: lo: ...&lt;/span&gt;
&lt;span class="c"&gt;# 2: ens32: &amp;lt;BROADCAST,MULTICAST,UP,LOWER_UP&amp;gt; mtu 1500 qdisc fq_codel state UP group default qlen 1000&lt;/span&gt;
&lt;span class="c"&gt;#     link/ether 00:0c:29:54:92:e9 brd ff:ff:ff:ff:ff:ff&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Interface names may vary (&lt;code&gt;ens33&lt;/code&gt;, &lt;code&gt;enp0s3&lt;/code&gt;, etc.).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  C. Grab an IP via DHCP
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ip &lt;span class="nb"&gt;link set &lt;/span&gt;ens32 up
&lt;span class="nb"&gt;sudo &lt;/span&gt;dhclient &lt;span class="nt"&gt;-v&lt;/span&gt; ens32
ip addr show ens32
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;inet 192.168.128.10/24 brd 192.168.128.255 scope global dynamic ens32
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Test connectivity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ping &lt;span class="nt"&gt;-c3&lt;/span&gt; 8.8.8.8    &lt;span class="c"&gt;# Should succeed&lt;/span&gt;
ping &lt;span class="nt"&gt;-c3&lt;/span&gt; google.com &lt;span class="c"&gt;# Should succeed&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  D. Create a Persistent NetworkManager Profile
&lt;/h3&gt;

&lt;p&gt;Use &lt;code&gt;nmcli&lt;/code&gt; so the interface auto‑connects on reboot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1) Remove any old/broken profile (if it exists)&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;nmcli connection delete vm-dhcp &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;

&lt;span class="c"&gt;# 2) Add a new DHCP-based Ethernet connection&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;nmcli connection add &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nb"&gt;type &lt;/span&gt;ethernet &lt;span class="se"&gt;\&lt;/span&gt;
  con-name vm-dhcp &lt;span class="se"&gt;\&lt;/span&gt;
  ifname ens32 &lt;span class="se"&gt;\&lt;/span&gt;
  autoconnect &lt;span class="nb"&gt;yes&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  ipv4.method auto

&lt;span class="c"&gt;# 3) Bring it up now&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;nmcli connection up vm-dhcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nmcli device status
&lt;span class="c"&gt;# DEVICE  TYPE      STATE      CONNECTION&lt;/span&gt;
&lt;span class="c"&gt;# ens32   ethernet  connected  vm-dhcp&lt;/span&gt;

ip addr show ens32
&lt;span class="c"&gt;# shows your 192.168.x.x address&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Confirm Everything Works
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ping &lt;span class="nt"&gt;-c3&lt;/span&gt; google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you get replies, congrats 🎉—you’ve restored full networking to your CentOS Stream Minimal VM!&lt;/p&gt;

&lt;h2&gt;
  
  
  Notes &amp;amp; Alternatives
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Driver‑only fix&lt;/strong&gt;
If you prefer to keep the PCnet32 adapter, load its driver:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  &lt;span class="nb"&gt;sudo &lt;/span&gt;modprobe pcnet32
  &lt;span class="nb"&gt;echo &lt;/span&gt;pcnet32 | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/modules-load.d/pcnet32.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You’ll still need a DHCP server on your bridged network.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bridged with DHCP&lt;/strong&gt;
If your physical LAN has DHCP and you need bridged mode, switch back to &lt;strong&gt;Bridged&lt;/strong&gt; after loading the driver or change the adapter type to &lt;strong&gt;e1000&lt;/strong&gt; or &lt;strong&gt;vmxnet3&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hope this helps you avoid the “No NIC except loopback” woes in your CentOS Stream Minimal VMs! 🚀&lt;/p&gt;

</description>
      <category>linux</category>
      <category>centos</category>
      <category>vmware</category>
      <category>networking</category>
    </item>
    <item>
      <title>🚦Tired of Port Collisions? How I Shifted Jenkins Off 8080 to 9595 (Ubuntu)</title>
      <dc:creator>Khuram Murad</dc:creator>
      <pubDate>Mon, 07 Jul 2025 04:12:00 +0000</pubDate>
      <link>https://dev.to/khurammurad/tired-of-port-collisions-how-i-shifted-jenkins-off-8080-to-9595-ubuntu-3gca</link>
      <guid>https://dev.to/khurammurad/tired-of-port-collisions-how-i-shifted-jenkins-off-8080-to-9595-ubuntu-3gca</guid>
      <description>&lt;p&gt;When Jenkins and my other apps both claimed port 8080, my workflows kept crashing. I tried editing &lt;code&gt;/etc/default/jenkins&lt;/code&gt;, fiddling with &lt;code&gt;HTTP_PORT&lt;/code&gt;, and even invoking &lt;code&gt;systemctl edit jenkins&lt;/code&gt;—but Jenkins stubbornly stuck to &lt;code&gt;--httpPort=8080&lt;/code&gt;. It took digging into systemd’s drop‑in mechanism and learning that &lt;strong&gt;modern Jenkins packages ignore&lt;/strong&gt; &lt;code&gt;/etc/default/jenkins&lt;/code&gt; in favor of &lt;strong&gt;&lt;code&gt;JENKINS_PORT&lt;/code&gt; overrides&lt;/strong&gt; to break free from port conflicts. In this post, I’ll walk you through exactly what went wrong, why those common fixes failed, and the &lt;strong&gt;four commands&lt;/strong&gt; that finally moved Jenkins to &lt;strong&gt;port 9595&lt;/strong&gt;—all with citations to official docs and community wisdom.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧩 The Problem
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Changing &lt;code&gt;/etc/default/jenkins&lt;/code&gt; had no effect.&lt;/strong&gt;
I set:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nv"&gt;HTTP_PORT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;9595
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;restarted Jenkins, but:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   ps aux | &lt;span class="nb"&gt;grep &lt;/span&gt;jenkins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;still showed &lt;code&gt;--httpPort=8080&lt;/code&gt; (&lt;a href="https://stackoverflow.com/questions/28340877/how-to-change-port-number-for-jenkins-installation-in-ubuntu-12-04?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;stackoverflow.com&lt;/a&gt;).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;systemctl edit jenkins&lt;/code&gt; overrides weren’t applying.&lt;/strong&gt;
No matter what I saved, &lt;code&gt;/etc/systemd/system/jenkins.service.d/override.conf&lt;/code&gt; stayed empty or missing, so the service unit never picked up my port (&lt;a href="https://askubuntu.com/questions/1398910/changed-jenkins-port-doesnt-applied?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;askubuntu.com&lt;/a&gt;).&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  🕵️ What Went Wrong ⚠️
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Jenkins 2.332.1+ packages now use systemd exclusively.&lt;/strong&gt; They ignore &lt;code&gt;/etc/default/jenkins&lt;/code&gt; and migrate old init settings into drop‑in overrides (&lt;a href="https://www.jenkins.io/doc/book/system-administration/systemd-services/?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;jenkins.io&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Although many guides still reference &lt;code&gt;HTTP_PORT&lt;/code&gt;, the &lt;strong&gt;systemd unit&lt;/strong&gt; actually honors &lt;strong&gt;&lt;code&gt;JENKINS_PORT&lt;/code&gt;&lt;/strong&gt; (&lt;a href="https://devops.stackexchange.com/questions/6430/how-to-change-jenkins-port-to-80?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;devops.stackexchange.com&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Without a valid override file in &lt;code&gt;/etc/systemd/system/jenkins.service.d/&lt;/code&gt;, Jenkins kept launching with its &lt;strong&gt;built‑in&lt;/strong&gt; &lt;code&gt;--httpPort=8080&lt;/code&gt; argument (&lt;a href="https://community.jenkins.io/t/systemd-is-failing-to-launch-jenkins/23733?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;community.jenkins.io&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Step‑by‑Step Fix: Manual Drop‑In Override
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Create the override directory
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; /etc/systemd/system/jenkins.service.d/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensures systemd will look for custom overrides (&lt;a href="https://www.jenkins.io/doc/book/system-administration/systemd-services/?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;jenkins.io&lt;/a&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Create (or edit) &lt;code&gt;override.conf&lt;/code&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/systemd/system/jenkins.service.d/override.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add these lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[Service]&lt;/span&gt;
&lt;span class="py"&gt;Environment&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"JENKINS_PORT=9595"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Why &lt;code&gt;JENKINS_PORT&lt;/code&gt;?&lt;/strong&gt; The official systemd unit template reads this variable when starting Jenkins, unlike &lt;code&gt;HTTP_PORT&lt;/code&gt; (&lt;a href="https://medium.com/%40aditya.sinha1342/how-to-change-the-default-port-of-jenkins-on-linux-rhel-centos-90693493ea9c?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;medium.com&lt;/a&gt;, &lt;a href="https://devops.stackexchange.com/questions/6430/how-to-change-jenkins-port-to-80?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;devops.stackexchange.com&lt;/a&gt;).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Save and exit (&lt;code&gt;Ctrl+O&lt;/code&gt; → &lt;code&gt;Enter&lt;/code&gt; → &lt;code&gt;Ctrl+X&lt;/code&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Reload systemd &amp;amp; restart Jenkins
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl daemon-reload
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart jenkins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes systemd pick up your new override (&lt;a href="https://www.jenkins.io/doc/book/system-administration/systemd-services/?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;jenkins.io&lt;/a&gt;).&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Verify the new port
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ss &lt;span class="nt"&gt;-tuln&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;9595
ps aux | &lt;span class="nb"&gt;grep &lt;/span&gt;jenkins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should now see &lt;code&gt;--httpPort=9595&lt;/code&gt; instead of &lt;code&gt;8080&lt;/code&gt; (&lt;a href="https://phoenixnap.com/kb/jenkins-change-port?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;phoenixnap.com&lt;/a&gt;).&lt;/p&gt;




&lt;h2&gt;
  
  
  🎉 Why This Works
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;systemd drop‑in files&lt;/strong&gt; are the supported way to customize services without editing core unit files, which get overwritten on upgrades (&lt;a href="https://www.jenkins.io/doc/book/system-administration/systemd-services/?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;jenkins.io&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Overriding &lt;strong&gt;&lt;code&gt;JENKINS_PORT&lt;/code&gt;&lt;/strong&gt; hooks into Jenkins’s existing startup logic—no need to rewrite the entire &lt;code&gt;ExecStart&lt;/code&gt; (&lt;a href="https://devops.stackexchange.com/questions/6430/how-to-change-jenkins-port-to-80?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;devops.stackexchange.com&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;This approach is &lt;strong&gt;upgrade‑safe&lt;/strong&gt;, avoids manual edits to &lt;code&gt;/lib/systemd/system/jenkins.service&lt;/code&gt;, and aligns with Jenkins’s official recommendations (&lt;a href="https://www.jenkins.io/doc/book/system-administration/systemd-services/?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;jenkins.io&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧪 Common Gotchas
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mistake&lt;/th&gt;
&lt;th&gt;Why it fails&lt;/th&gt;
&lt;th&gt;Correct fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Editing &lt;code&gt;/etc/default/jenkins&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Ignored by modern systemd‑managed packages&lt;/td&gt;
&lt;td&gt;Use drop‑in override with &lt;code&gt;JENKINS_PORT&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Modifying core systemd unit file&lt;/td&gt;
&lt;td&gt;Overwritten on upgrades&lt;/td&gt;
&lt;td&gt;Create &lt;code&gt;/etc/systemd/system/...d/override.conf&lt;/code&gt; (&lt;a href="https://www.jenkins.io/doc/book/system-administration/systemd-services/?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;jenkins.io&lt;/a&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;code&gt;systemctl edit&lt;/code&gt; didn’t save&lt;/td&gt;
&lt;td&gt;Editor or permissions issue&lt;/td&gt;
&lt;td&gt;Manually create the file as above&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Still seeing port 8080&lt;/td&gt;
&lt;td&gt;Override file missing or malformed&lt;/td&gt;
&lt;td&gt;Confirm &lt;code&gt;/etc/systemd/system/jenkins.service.d/override.conf&lt;/code&gt; exists and is correct&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  ✅ Final Checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Confirm override file exists:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; /etc/systemd/system/jenkins.service.d/override.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Inspect its contents:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cat&lt;/span&gt; /etc/systemd/system/jenkins.service.d/override.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Reload &amp;amp; restart:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl daemon-reload
   &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart jenkins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Verify the port:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;ss &lt;span class="nt"&gt;-tuln&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;9595
   ps aux | &lt;span class="nb"&gt;grep &lt;/span&gt;jenkins
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🚀 Beyond the Port
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SSL/TLS via reverse proxy&lt;/strong&gt; (Nginx/Apache) — leverage &lt;code&gt;JENKINS_HTTPS_PORT&lt;/code&gt; in the same drop‑in (&lt;a href="https://devops.stackexchange.com/questions/6430/how-to-change-jenkins-port-to-80?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;devops.stackexchange.com&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Additional JVM options&lt;/strong&gt; — set &lt;code&gt;Environment="JAVA_OPTS=…"&lt;/code&gt; alongside &lt;code&gt;JENKINS_PORT&lt;/code&gt; for memory tuning or custom flags.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automate with Ansible or Puppet&lt;/strong&gt; — manage your override file declaratively so every build agent uses the same port.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Happy building!&lt;/em&gt;&lt;/p&gt;




&lt;h4&gt;
  
  
  References
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Changelog for Jenkins systemd overrides — Jenkins official docs (&lt;a href="https://www.jenkins.io/doc/book/system-administration/systemd-services/?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;jenkins.io&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Ask Ubuntu: Changed Jenkins port doesn’t apply (&lt;a href="https://askubuntu.com/questions/1398910/changed-jenkins-port-doesnt-applied?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;askubuntu.com&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;DevOps.SE: Changing Jenkins port to 80 via systemd (&lt;a href="https://devops.stackexchange.com/questions/6430/how-to-change-jenkins-port-to-80?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;devops.stackexchange.com&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;phoenixNAP: How to change port for Jenkins on Linux (&lt;a href="https://phoenixnap.com/kb/jenkins-change-port?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;phoenixnap.com&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Medium: Change default Jenkins port on RHEL/CentOS (&lt;a href="https://medium.com/%40aditya.sinha1342/how-to-change-the-default-port-of-jenkins-on-linux-rhel-centos-90693493ea9c?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;medium.com&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;StackOverflow: Change Jenkins default port in Ubuntu 12.04 (&lt;a href="https://stackoverflow.com/questions/28340877/how-to-change-port-number-for-jenkins-installation-in-ubuntu-12-04?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;stackoverflow.com&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Community Jenkins forum: systemd failing to launch Jenkins (&lt;a href="https://community.jenkins.io/t/systemd-is-failing-to-launch-jenkins/23733?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;community.jenkins.io&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;YouTube: How to change Jenkins default port (JENKINS_PORT segment) (&lt;a href="https://www.youtube.com/watch?v=BLmZYaSKFiA&amp;amp;utm_source=chatgpt.com" rel="noopener noreferrer"&gt;youtube.com&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Scaler: Changing Jenkins default port guidelines (&lt;a href="https://www.scaler.com/topics/jenkins-default-port/?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;scaler.com&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;AskUbuntu: Fixing Jenkins port override issues (&lt;a href="https://askubuntu.com/questions/1398910/changed-jenkins-port-doesnt-applied?utm_source=chatgpt.com" rel="noopener noreferrer"&gt;askubuntu.com&lt;/a&gt;)&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>jenkins</category>
      <category>alnafi</category>
    </item>
    <item>
      <title>The Ultimate Guide to SSH Hardening: Secure Your Remote Access</title>
      <dc:creator>Khuram Murad</dc:creator>
      <pubDate>Sat, 21 Jun 2025 05:22:12 +0000</pubDate>
      <link>https://dev.to/khurammurad/the-ultimate-guide-to-ssh-hardening-secure-your-remote-access-40gj</link>
      <guid>https://dev.to/khurammurad/the-ultimate-guide-to-ssh-hardening-secure-your-remote-access-40gj</guid>
      <description>&lt;p&gt;🔒 &lt;strong&gt;SSH (Secure Shell)&lt;/strong&gt; is the backbone of remote server administration, but its default configuration is often insecure. Without proper hardening, your server could be vulnerable to brute-force attacks, unauthorized access, and exploits.  &lt;/p&gt;

&lt;p&gt;In this guide, I’ll walk you through &lt;strong&gt;professional-grade SSH security practices&lt;/strong&gt;, explaining each step in detail to ensure your remote access remains both &lt;strong&gt;secure and functional&lt;/strong&gt;.  &lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;🔧 Step 1: Installation &amp;amp; Basic Configuration&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Why Start Here?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Before tweaking security settings, ensure OpenSSH is installed and running. Some Linux distributions don’t include the SSH server by default.  &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Check if SSH is Installed&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-V&lt;/span&gt;  &lt;span class="c"&gt;# Shows OpenSSH version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;Expected Output:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OpenSSH_8.9p1 Ubuntu-3, OpenSSL 3.0.2 15 Mar 2022  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If not installed, proceed to installation.  &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;2. Install OpenSSH Server&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Debian/Ubuntu&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;openssh-server &lt;span class="nt"&gt;-y&lt;/span&gt;

&lt;span class="c"&gt;# RHEL/CentOS&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install &lt;/span&gt;openssh-server &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;What This Does:&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Installs the OpenSSH server package.
&lt;/li&gt;
&lt;li&gt;Enables SSH access on port &lt;strong&gt;22&lt;/strong&gt; (default).
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;3. Verify SSH Service Status&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status ssh  &lt;span class="c"&gt;# Ubuntu&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status sshd &lt;span class="c"&gt;# RHEL/CentOS&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;Expected Output:&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Active: active (running)&lt;/code&gt; means SSH is working.
&lt;/li&gt;
&lt;li&gt;If not running, start it with:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start sshd &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;sshd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;🔐 Step 2: Hardening SSH Configuration (&lt;code&gt;sshd_config&lt;/code&gt;)&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Why Harden &lt;code&gt;sshd_config&lt;/code&gt;?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The default SSH configuration allows &lt;strong&gt;password logins, root access, and weak encryption&lt;/strong&gt;, making it an easy target for attackers.  &lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Backup the Original Config (Safety First!)&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo cp&lt;/span&gt; /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;Why?&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If something breaks, you can restore the original config.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;2. Edit &lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/ssh/sshd_config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apply these &lt;strong&gt;critical security settings&lt;/strong&gt;:  &lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;strong&gt;Setting&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Value&lt;/strong&gt;&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Why?&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Port 2222&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Change from &lt;code&gt;22&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Avoids automated bots scanning port 22&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PermitRootLogin no&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Disable root login&lt;/td&gt;
&lt;td&gt;Prevents attackers from targeting root&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PasswordAuthentication no&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Disable password login&lt;/td&gt;
&lt;td&gt;Forces key-based auth (more secure)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PubkeyAuthentication yes&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Enable SSH keys&lt;/td&gt;
&lt;td&gt;Allows only authorized users&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;X11Forwarding no&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Disable GUI forwarding&lt;/td&gt;
&lt;td&gt;Reduces attack surface&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;MaxAuthTries 3&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Limit login attempts&lt;/td&gt;
&lt;td&gt;Stops brute-force attacks&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;AllowUsers your_username&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Restrict access&lt;/td&gt;
&lt;td&gt;Only allows specified users&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;3. Restart SSH to Apply Changes&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart sshd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;Verify the new port is active:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ss &lt;span class="nt"&gt;-tulnp&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;sshd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tcp   LISTEN 0 128  0.0.0.0:2222  0.0.0.0:*  users:(("sshd",pid=1234,fd=3))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;🔑 Step 3: Key-Based Authentication (More Secure Than Passwords)&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Why Use SSH Keys?&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Passwords can be cracked&lt;/strong&gt; with brute-force attacks.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SSH keys&lt;/strong&gt; use cryptographic authentication, making unauthorized access nearly impossible.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Generate SSH Keys (On Your Local Machine)&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; ed25519 &lt;span class="nt"&gt;-a&lt;/span&gt; 100 &lt;span class="nt"&gt;-f&lt;/span&gt; ~/.ssh/server_access &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"your_email@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;Explanation:&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;-t ed25519&lt;/code&gt;: Uses modern, secure encryption.
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-a 100&lt;/code&gt;: Adds 100 rounds of key derivation (extra security).
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;-f ~/.ssh/server_access&lt;/code&gt;: Saves the key in a custom file.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;2. Copy Public Key to Server&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-copy-id &lt;span class="nt"&gt;-i&lt;/span&gt; ~/.ssh/server_access.pub &lt;span class="nt"&gt;-p&lt;/span&gt; 2222 user@server_ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;Alternative (Manual Method):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; ~/.ssh/server_access.pub | ssh &lt;span class="nt"&gt;-p&lt;/span&gt; 2222 user@server_ip &lt;span class="s2"&gt;"mkdir -p ~/.ssh &amp;amp;&amp;amp; cat &amp;gt;&amp;gt; ~/.ssh/authorized_keys"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;3. Test Key-Based Login&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-i&lt;/span&gt; ~/.ssh/server_access &lt;span class="nt"&gt;-p&lt;/span&gt; 2222 user@server_ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;Expected Result:&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If configured correctly, you’ll log in &lt;strong&gt;without a password&lt;/strong&gt;.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;🛡️ Step 4: Firewall Rules (Restrict SSH Access)&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Why Use a Firewall?&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Blocks unauthorized IPs.
&lt;/li&gt;
&lt;li&gt;Limits brute-force attacks.
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;UFW (Ubuntu/Debian)&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 2222/tcp comment &lt;span class="s1"&gt;'SSH access'&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw limit 2222/tcp  &lt;span class="c"&gt;# Rate-limiting (blocks repeated attempts)&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw &lt;span class="nb"&gt;enable&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Firewalld (RHEL/CentOS)&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;firewall-cmd &lt;span class="nt"&gt;--permanent&lt;/span&gt; &lt;span class="nt"&gt;--add-port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2222/tcp
&lt;span class="nb"&gt;sudo &lt;/span&gt;firewall-cmd &lt;span class="nt"&gt;--reload&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;Verify Firewall Rules:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw status  &lt;span class="c"&gt;# Ubuntu&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;firewall-cmd &lt;span class="nt"&gt;--list-ports&lt;/span&gt;  &lt;span class="c"&gt;# RHEL/CentOS&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;🚨 Advanced Security: Fail2Ban &amp;amp; 2FA&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Fail2Ban (Automatically Blocks Attackers)&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;fail2ban  &lt;span class="c"&gt;# Ubuntu&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install &lt;/span&gt;fail2ban  &lt;span class="c"&gt;# RHEL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Configuration (&lt;code&gt;/etc/fail2ban/jail.local&lt;/code&gt;):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[sshd]&lt;/span&gt;
&lt;span class="py"&gt;enabled&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;true&lt;/span&gt;
&lt;span class="py"&gt;port&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;2222&lt;/span&gt;
&lt;span class="py"&gt;maxretry&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;3  # Blocks after 3 failed attempts&lt;/span&gt;
&lt;span class="py"&gt;bantime&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;1h  # Bans for 1 hour&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;2. Two-Factor Authentication (2FA) for SSH&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;libpam-google-authenticator
google-authenticator  &lt;span class="c"&gt;# Follow setup instructions&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Edit &lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt;:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AuthenticationMethods publickey,keyboard-interactive
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;Now, logging in requires:&lt;/strong&gt;  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;SSH Key
&lt;/li&gt;
&lt;li&gt;Google Authenticator Code
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;🔍 Monitoring &amp;amp; Maintenance&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Check Failed Login Attempts&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo grep&lt;/span&gt; &lt;span class="s2"&gt;"Failed password"&lt;/span&gt; /var/log/auth.log  &lt;span class="c"&gt;# Ubuntu&lt;/span&gt;
&lt;span class="nb"&gt;sudo grep&lt;/span&gt; &lt;span class="s2"&gt;"Failed password"&lt;/span&gt; /var/log/secure   &lt;span class="c"&gt;# RHEL&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;2. Test SSH Config Before Applying&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;sshd &lt;span class="nt"&gt;-t&lt;/span&gt;  &lt;span class="c"&gt;# Checks for syntax errors&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;Best Practice:&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Regularly update OpenSSH&lt;/strong&gt; (&lt;code&gt;sudo apt upgrade openssh-server&lt;/code&gt;).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Review logs&lt;/strong&gt; for suspicious activity.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;✅ Final Security Checklist&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;[ ] Changed default SSH port
&lt;/li&gt;
&lt;li&gt;[ ] Disabled root login
&lt;/li&gt;
&lt;li&gt;[ ] Disabled password authentication
&lt;/li&gt;
&lt;li&gt;[ ] Enabled SSH key-based auth
&lt;/li&gt;
&lt;li&gt;[ ] Configured firewall rules
&lt;/li&gt;
&lt;li&gt;[ ] Set up Fail2Ban
&lt;/li&gt;
&lt;li&gt;[ ] Restricted user access
&lt;/li&gt;
&lt;li&gt;[ ] Enabled session timeouts
&lt;/li&gt;
&lt;li&gt;[ ] Tested backup access method
&lt;/li&gt;
&lt;li&gt;[ ] Documented all changes
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;🚀 Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;By following these steps, you’ve &lt;strong&gt;dramatically improved SSH security&lt;/strong&gt; by:&lt;br&gt;&lt;br&gt;
✔ &lt;strong&gt;Eliminating password-based attacks&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
✔ &lt;strong&gt;Blocking brute-force attempts&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
✔ &lt;strong&gt;Restricting unauthorized access&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Want even more security?&lt;/strong&gt; Consider:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Port knocking&lt;/strong&gt; (hidden SSH port)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;VPN-based SSH access&lt;/strong&gt; (extra layer)
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated log monitoring&lt;/strong&gt; (SIEM tools)
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔗 &lt;strong&gt;Further Reading:&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.ssh.com/academy/ssh/sshd_config" rel="noopener noreferrer"&gt;OpenSSH Best Practices&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://media.defense.gov/2021/Oct/06/2002869850/-1/-1/0/CTR_NSA_SSH_HARDENING_GUIDANCE_20211006.PDF" rel="noopener noreferrer"&gt;NSA SSH Hardening Guide&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🚨 &lt;strong&gt;Stay secure, and happy administering!&lt;/strong&gt; 🚀&lt;/p&gt;

</description>
      <category>security</category>
      <category>ssh</category>
      <category>grc</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>🐳 [Fix] Can't Install Docker on Ubuntu 22.04? Here's the Real Solution (NO_PUBKEY Error)</title>
      <dc:creator>Khuram Murad</dc:creator>
      <pubDate>Sat, 03 May 2025 13:02:17 +0000</pubDate>
      <link>https://dev.to/khurammurad/fix-cant-install-docker-on-ubuntu-2204-heres-the-real-solution-nopubkey-error-465m</link>
      <guid>https://dev.to/khurammurad/fix-cant-install-docker-on-ubuntu-2204-heres-the-real-solution-nopubkey-error-465m</guid>
      <description>&lt;h3&gt;
  
  
  🚀 Fix the GPG Key Error and Install Docker on Ubuntu 22.04
&lt;/h3&gt;

&lt;p&gt;Follow these steps carefully to resolve the GPG key issue and ensure a clean Docker installation. Run each command exactly as shown to avoid syntax errors.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Remove Any Existing Docker Repository Configuration
&lt;/h4&gt;

&lt;p&gt;To avoid conflicts or malformed entries, let’s clean up any existing Docker repository files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo rm&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; /etc/apt/sources.list.d/docker.list
&lt;span class="nb"&gt;sudo rm&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; /etc/apt/keyrings/docker.gpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. Update and Install Prerequisites
&lt;/h4&gt;

&lt;p&gt;Ensure your system has the necessary tools:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; ca-certificates curl gnupg lsb-release
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;-y&lt;/code&gt; flag automatically confirms the installation.&lt;/li&gt;
&lt;li&gt;This step ensures &lt;code&gt;curl&lt;/code&gt; and &lt;code&gt;gnupg&lt;/code&gt; are available for fetching and processing the GPG key.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  3. Add Docker’s GPG Key Securely
&lt;/h4&gt;

&lt;p&gt;Set up the keyring directory and fetch Docker’s GPG key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; /etc/apt/keyrings
&lt;span class="nb"&gt;sudo chmod &lt;/span&gt;755 /etc/apt/keyrings
curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://download.docker.com/linux/ubuntu/gpg | &lt;span class="nb"&gt;sudo &lt;/span&gt;gpg &lt;span class="nt"&gt;--dearmor&lt;/span&gt; &lt;span class="nt"&gt;-o&lt;/span&gt; /etc/apt/keyrings/docker.gpg
&lt;span class="nb"&gt;sudo chmod &lt;/span&gt;a+r /etc/apt/keyrings/docker.gpg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;mkdir -p&lt;/code&gt; ensures the directory is created if it doesn’t exist.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;chmod 755&lt;/code&gt; sets correct directory permissions.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;chmod a+r&lt;/code&gt; makes the key readable by all users, which &lt;code&gt;apt&lt;/code&gt; requires.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  4. Add the Docker Repository
&lt;/h4&gt;

&lt;p&gt;Add the Docker repository to your APT sources:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="s2"&gt;"deb [arch=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;dpkg &lt;span class="nt"&gt;--print-architecture&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt; signed-by=/etc/apt/keyrings/docker.gpg] &lt;/span&gt;&lt;span class="se"&gt;\&lt;/span&gt;&lt;span class="s2"&gt;
  https://download.docker.com/linux/ubuntu &lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;lsb_release &lt;span class="nt"&gt;-cs&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt; stable"&lt;/span&gt; | &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/apt/sources.list.d/docker.list &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /dev/null
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This command dynamically sets the architecture (e.g., &lt;code&gt;amd64&lt;/code&gt;, &lt;code&gt;arm64&lt;/code&gt;) and Ubuntu codename (e.g., &lt;code&gt;jammy&lt;/code&gt; for 22.04).&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;tee&lt;/code&gt; command writes the repository configuration to &lt;code&gt;/etc/apt/sources.list.d/docker.list&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Verify the file content to ensure no syntax errors:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /etc/apt/sources.list.d/docker.list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output (example for &lt;code&gt;amd64&lt;/code&gt; on Ubuntu 22.04):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the output looks malformed (e.g., extra characters, missing spaces), delete the file (&lt;code&gt;sudo rm /etc/apt/sources.list.d/docker.list&lt;/code&gt;) and rerun the &lt;code&gt;echo&lt;/code&gt; command.&lt;/p&gt;

&lt;h4&gt;
  
  
  5. Update APT and Install Docker
&lt;/h4&gt;

&lt;p&gt;Now update the package index and install Docker:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If you see the GPG error again (&lt;code&gt;NO_PUBKEY 7EA0A9C3F273FCD8&lt;/code&gt;), double-check the GPG key step and permissions on &lt;code&gt;/etc/apt/keyrings/docker.gpg&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;-y&lt;/code&gt; flag skips confirmation prompts.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  6. Verify Docker Installation
&lt;/h4&gt;

&lt;p&gt;Test Docker to ensure it’s working:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;docker run hello-world
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This pulls a test image and runs a container. If successful, you’ll see a message confirming Docker is working.&lt;/p&gt;




&lt;h3&gt;
  
  
  🙌 Optional: Run Docker Without &lt;code&gt;sudo&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;To avoid typing &lt;code&gt;sudo&lt;/code&gt; for Docker commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; docker &lt;span class="nv"&gt;$USER&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Log out and back in, or run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;newgrp docker
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Test it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run hello-world
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  🛠 Troubleshooting the "Token" Error
&lt;/h3&gt;

&lt;p&gt;The "found character that cannot start any token" error is likely unrelated to the GPG key issue but could stem from:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Malformed &lt;code&gt;/etc/apt/sources.list.d/docker.list&lt;/code&gt;&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If the repository file contains invalid characters (e.g., extra quotes, spaces, or tabs), &lt;code&gt;apt&lt;/code&gt; might fail.&lt;/li&gt;
&lt;li&gt;Check the file:
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; &lt;span class="nb"&gt;cat&lt;/span&gt; /etc/apt/sources.list.d/docker.list
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;If it’s incorrect, remove it and recreate it using the &lt;code&gt;echo&lt;/code&gt; command in step 4.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Docker Compose YAML File&lt;/strong&gt; (if applicable):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you’re using Docker Compose and have a &lt;code&gt;docker-compose.yml&lt;/code&gt; file, the error could indicate a syntax issue (e.g., invalid indentation, stray characters).&lt;/li&gt;
&lt;li&gt;Check the file for errors:
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; docker-compose config
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;If you have a &lt;code&gt;docker-compose.yml&lt;/code&gt;, share its contents, and I can help identify the issue.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Corrupted APT Cache&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clear the APT cache and try again:
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get clean
 &lt;span class="nb"&gt;sudo rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; /var/lib/apt/lists/&lt;span class="k"&gt;*&lt;/span&gt;
 &lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get update
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Locale or Environment Issues&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensure your system’s locale is set correctly, as some tools misbehave with invalid locales:
&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; locale
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;If the output shows errors, set a valid locale:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;locale-gen en_US.UTF-8
 &lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;LC_ALL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;en_US.UTF-8
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔍 If the Issue Persists
&lt;/h3&gt;

&lt;p&gt;If you still encounter the GPG key error or the "token" error, please provide:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The exact error message when running &lt;code&gt;sudo apt-get update&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The contents of &lt;code&gt;/etc/apt/sources.list.d/docker.list&lt;/code&gt; (run &lt;code&gt;cat /etc/apt/sources.list.d/docker.list&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;If using Docker Compose, share your &lt;code&gt;docker-compose.yml&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;The output of &lt;code&gt;ls -l /etc/apt/keyrings/docker.gpg&lt;/code&gt; to verify permissions.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  ✅ Final Notes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The steps above align with Docker’s official installation guide for Ubuntu and account for Ubuntu 22.04’s stricter APT security.&lt;/li&gt;
&lt;li&gt;The "token" error is likely a secondary issue, possibly from a malformed configuration. The cleanup and precise commands above should prevent it.&lt;/li&gt;
&lt;li&gt;If you’re still stuck, share the additional details, and I’ll tailor the solution further.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Happy containerizing! 🐳 Let me know if you need more help.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>ubuntu</category>
      <category>containerization</category>
    </item>
    <item>
      <title>🛠️ Resolving GRUB Boot Issues After Reinstalling Windows 11 in a Dual-Boot Setup</title>
      <dc:creator>Khuram Murad</dc:creator>
      <pubDate>Sat, 22 Feb 2025 10:07:59 +0000</pubDate>
      <link>https://dev.to/khurammurad/resolving-grub-boot-issues-after-reinstalling-windows-11-in-a-dual-boot-setup-5g12</link>
      <guid>https://dev.to/khurammurad/resolving-grub-boot-issues-after-reinstalling-windows-11-in-a-dual-boot-setup-5g12</guid>
      <description>&lt;p&gt;Dual-booting Windows and Ubuntu offers the flexibility of both operating systems on a single machine. However, reinstalling Windows can sometimes disrupt the GRUB bootloader, leading to boot issues. This guide provides a straightforward solution to restore GRUB functionality and reintegrate Windows into the boot menu.&lt;/p&gt;

&lt;h2&gt;
  
  
  📝 The Issue
&lt;/h2&gt;

&lt;p&gt;After performing a fresh installation of Windows 11 on a system that also runs Ubuntu, you might encounter the following problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GRUB Bootloader Missing&lt;/strong&gt;: The system boots directly into Windows without displaying the GRUB menu.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows Entry in GRUB Fails&lt;/strong&gt;: Selecting Windows from the GRUB menu results in errors like &lt;code&gt;no such device: 22a5-da27&lt;/code&gt; or &lt;code&gt;error: unknown filesystem&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These issues arise because reinstalling Windows can overwrite the GRUB bootloader and change partition UUIDs, causing mismatches in GRUB's configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔧 Solution Overview
&lt;/h2&gt;

&lt;p&gt;To resolve these issues, we'll:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Restore GRUB Bootloader&lt;/strong&gt;: Modify the boot order in BIOS/UEFI settings to prioritize Ubuntu, allowing access to the GRUB menu.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Update GRUB Configuration&lt;/strong&gt;: Identify the new UUID of the Windows partition and update GRUB's configuration to reflect this change.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  🛠️ Step-by-Step Guide
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Modify Boot Order in BIOS/UEFI
&lt;/h3&gt;

&lt;p&gt;Reinstalling Windows often changes the boot sequence, setting Windows Boot Manager as the default. To access GRUB:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Access BIOS/UEFI Settings&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Restart your computer and enter the BIOS/UEFI setup by pressing the designated key (commonly &lt;code&gt;F2&lt;/code&gt;, &lt;code&gt;F10&lt;/code&gt;, &lt;code&gt;Delete&lt;/code&gt;, or &lt;code&gt;Esc&lt;/code&gt;) during startup.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Change Boot Priority&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Navigate to the boot settings and set the Ubuntu drive or GRUB bootloader as the primary boot option.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Save and Exit&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Save the changes and restart your computer. The GRUB menu should now appear, allowing you to boot into Ubuntu.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Update GRUB Configuration with the Correct UUID
&lt;/h3&gt;

&lt;p&gt;Once you're back in Ubuntu, update GRUB to recognize the current UUID of the Windows partition:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Open Terminal&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Boot into Ubuntu and open the terminal.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Identify Windows Partition&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run:
&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;lsblk &lt;span class="nt"&gt;-f&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;ul&gt;
&lt;li&gt;Locate the Windows partition (typically formatted as &lt;code&gt;ntfs&lt;/code&gt;). Note its mount point (e.g., &lt;code&gt;/mnt/boot/efi&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Find the UUID&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run:
&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;blkid
&lt;/code&gt;&lt;/pre&gt;



&lt;ul&gt;
&lt;li&gt;Find the UUID corresponding to the Windows partition.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Edit GRUB Configuration&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the custom configuration file:
&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;vi /etc/grub.d/40_custom
&lt;/code&gt;&lt;/pre&gt;



&lt;ul&gt;
&lt;li&gt;Add the following entry, replacing &lt;code&gt;YOUR_UUID&lt;/code&gt; with the UUID obtained earlier:
&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;menuentry &lt;span class="s2"&gt;"Windows 11"&lt;/span&gt; &lt;span class="nt"&gt;--class&lt;/span&gt; windows &lt;span class="nt"&gt;--class&lt;/span&gt; os &lt;span class="o"&gt;{&lt;/span&gt;
    insmod part_gpt
    insmod ntfs
    search &lt;span class="nt"&gt;--no-floppy&lt;/span&gt; &lt;span class="nt"&gt;--set&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;root &lt;span class="nt"&gt;--fs-uuid&lt;/span&gt; YOUR_UUID
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Update GRUB&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Save the file and run:
&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;update-grub
&lt;/code&gt;&lt;/pre&gt;



&lt;ul&gt;
&lt;li&gt;This command regenerates the GRUB configuration to include the updated Windows entry.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Verify the Solution
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Reboot the System&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Restart your computer. The GRUB menu should display an option for "Windows 11".&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Test Booting into Windows&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Select "Windows 11" from the GRUB menu to ensure it boots correctly.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  🎯 Conclusion
&lt;/h2&gt;

&lt;p&gt;By following these steps, you can restore the GRUB bootloader and ensure both Ubuntu and Windows 11 are accessible in your dual-boot setup. This approach addresses the common issue of GRUB not recognizing Windows after a fresh installation due to UUID changes.&lt;/p&gt;

&lt;p&gt;For more detailed information, you can refer to this Ask Ubuntu discussion: &lt;a href="http://www.askubuntu.com" rel="noopener noreferrer"&gt;askubuntu.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feel free to share this guide with others who might encounter similar issues!&lt;/p&gt;

</description>
      <category>dualboot</category>
      <category>grub2</category>
    </item>
    <item>
      <title>🚀 How I Fixed "Not Enough Free Space in /var" While Upgrading Kali Linux</title>
      <dc:creator>Khuram Murad</dc:creator>
      <pubDate>Sun, 09 Feb 2025 09:51:37 +0000</pubDate>
      <link>https://dev.to/khurammurad/-how-i-fixed-not-enough-free-space-in-var-while-upgrading-kali-linux-25j5</link>
      <guid>https://dev.to/khurammurad/-how-i-fixed-not-enough-free-space-in-var-while-upgrading-kali-linux-25j5</guid>
      <description>&lt;p&gt;While upgrading my &lt;strong&gt;Kali Linux&lt;/strong&gt; running on &lt;strong&gt;VMware&lt;/strong&gt;, I encountered this error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;E: You don't have enough free space in /var/cache/apt/archives/.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When I checked my disk space using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I found that my &lt;code&gt;/var&lt;/code&gt; partition was almost &lt;strong&gt;full&lt;/strong&gt;, preventing the system from downloading and installing updates.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;🔍 Investigating the Disk Space&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To analyze the situation, I ran:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lsblk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Disk Layout Before Fixing the Issue:&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME                     SIZE  USED AVAIL MOUNTPOINTS
sda                      500G  
├─sda1                   487M  186M  245M /boot
├─sda2                   124.5G  
│ ├─kalilinux--vg-root    23G   14G  8.3G /
│ ├─kalilinux--vg-var    9.3G  7.2G  1.5G /var
│ ├─kalilinux--vg-home   89.1G  227M  83G /home
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I had already &lt;strong&gt;expanded my VMware virtual disk to 500GB&lt;/strong&gt;, but my &lt;strong&gt;LVM partitions&lt;/strong&gt; hadn’t been extended to use the extra space.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;🛠️ Step-by-Step Solution: Expanding the &lt;code&gt;/var&lt;/code&gt; Partition in LVM&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Since my Kali Linux uses &lt;strong&gt;LVM (Logical Volume Manager)&lt;/strong&gt;, I had to allocate more space to &lt;code&gt;/var&lt;/code&gt;.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;📌 Step 1: Expanding the Virtual Disk in VMware&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If you're using &lt;strong&gt;VMware&lt;/strong&gt;, you can increase the disk size:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Power off&lt;/strong&gt; your Kali Linux VM.
&lt;/li&gt;
&lt;li&gt;Open &lt;strong&gt;VMware Workstation/Player&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;Go to &lt;strong&gt;VM Settings &amp;gt; Hard Disk &amp;gt; Expand&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;Increase the disk size to &lt;strong&gt;500GB&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Apply changes &amp;amp; boot into Kali Linux.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;After this, the virtual disk (&lt;code&gt;/dev/sda&lt;/code&gt;) now had extra space, but the &lt;strong&gt;partitions hadn’t changed yet&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;📌 Step 2: Checking Available Space&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;After booting up Kali, I checked the available space using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;lsblk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Output Before Resizing Partitions:&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NAME                     SIZE  USED AVAIL MOUNTPOINTS
sda                      500G  
├─sda1                   487M  
├─sda2                   124.5G  
│ ├─kalilinux--vg-root    23G  
│ ├─kalilinux--vg-var    9.3G  
│ ├─kalilinux--vg-home   89.1G  
└─ Free space            375G  (Unused)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I had &lt;strong&gt;375GB of free space&lt;/strong&gt; that needed to be allocated to &lt;code&gt;/var&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;📌 Step 3: Resizing the Partition (&lt;code&gt;/dev/sda5&lt;/code&gt;) to Use the Free Space&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I had to extend &lt;code&gt;/dev/sda5&lt;/code&gt; (the &lt;strong&gt;LVM partition&lt;/strong&gt;) to use the extra 375GB.  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Open &lt;code&gt;cfdisk&lt;/code&gt; to edit partitions&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;cfdisk /dev/sda
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Select &lt;code&gt;/dev/sda2&lt;/code&gt; (Extended Partition)&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;Resize&lt;/strong&gt; and extend it to &lt;strong&gt;fill the free space&lt;/strong&gt;.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Select &lt;code&gt;/dev/sda5&lt;/code&gt;&lt;/strong&gt; inside &lt;code&gt;/dev/sda2&lt;/code&gt;, and &lt;strong&gt;resize it&lt;/strong&gt; to use all available space.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write changes&lt;/strong&gt; and exit.
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;🚨 &lt;strong&gt;Important:&lt;/strong&gt; Reboot the system for changes to take effect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;reboot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;📌 Step 4: Expanding LVM to Use the New Space&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;After rebooting, I had to tell &lt;strong&gt;LVM&lt;/strong&gt; to use the expanded partition.  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Resize the LVM Physical Volume:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;pvresize /dev/sda5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check how much free space is available in the Volume Group:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;vgdisplay
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for &lt;strong&gt;"Free PE / Size"&lt;/strong&gt;, which should now show the extra space.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;📌 Step 5: Extending the &lt;code&gt;/var&lt;/code&gt; Logical Volume&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Since &lt;code&gt;/var&lt;/code&gt; was running out of space, I extended it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;lvextend &lt;span class="nt"&gt;-L&lt;/span&gt; +30G /dev/mapper/kalilinux--vg-var
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or, to use &lt;strong&gt;all available space&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;lvextend &lt;span class="nt"&gt;-l&lt;/span&gt; +100%FREE /dev/mapper/kalilinux--vg-var
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;📌 Step 6: Resizing the &lt;code&gt;/var&lt;/code&gt; Filesystem&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Now that the partition was larger, I had to resize the filesystem:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;resize2fs /dev/mapper/kalilinux--vg-var
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For &lt;strong&gt;XFS filesystems&lt;/strong&gt;, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;xfs_growfs /var
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;📌 Step 7: Verify the New Space&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To confirm that &lt;code&gt;/var&lt;/code&gt; had more space, I ran:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;df&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Output After Resizing:&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/kalilinux--vg-var  40G   7.2G  32G   20% /var
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;code&gt;/var&lt;/code&gt; now had plenty of space for updates!&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;📌 Step 8: Running the Upgrade Again&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Now that &lt;code&gt;/var&lt;/code&gt; had enough space, I retried the upgrade:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This time, the upgrade completed &lt;strong&gt;successfully&lt;/strong&gt; without any storage issues! 🎉&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;🔚 Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you're running &lt;strong&gt;Kali Linux in VMware&lt;/strong&gt; and get a &lt;strong&gt;"Not Enough Free Space in /var"&lt;/strong&gt; error, follow these steps:  &lt;/p&gt;

&lt;p&gt;✔ &lt;strong&gt;Expand the virtual disk in VMware&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
✔ &lt;strong&gt;Resize the partitions (&lt;code&gt;/dev/sda5&lt;/code&gt;)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
✔ &lt;strong&gt;Update LVM with &lt;code&gt;pvresize&lt;/code&gt;, &lt;code&gt;lvextend&lt;/code&gt;, and &lt;code&gt;resize2fs&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
✔ &lt;strong&gt;Retry the upgrade!&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;This method works not only for &lt;strong&gt;Kali Linux&lt;/strong&gt;, but for any &lt;strong&gt;LVM-based Linux system&lt;/strong&gt; running in a &lt;strong&gt;VM&lt;/strong&gt; or a physical machine.  &lt;/p&gt;

&lt;p&gt;If this guide helped you, feel free to share it! 🚀🔥  &lt;/p&gt;




&lt;p&gt;✍️ &lt;strong&gt;Author: Khuram Murad&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
📌 &lt;strong&gt;Follow me for more Linux tips!&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Set Up OpenShift Local (CRC) on Ubuntu: A Developer's Guide</title>
      <dc:creator>Khuram Murad</dc:creator>
      <pubDate>Sun, 05 Jan 2025 15:00:03 +0000</pubDate>
      <link>https://dev.to/khurammurad/how-to-set-up-openshift-local-crc-on-ubuntu-a-developers-guide-le2</link>
      <guid>https://dev.to/khurammurad/how-to-set-up-openshift-local-crc-on-ubuntu-a-developers-guide-le2</guid>
      <description>&lt;p&gt;Red Hat's CodeReady Containers (CRC) provides developers with a lightweight, local OpenShift 4 cluster perfect for development and testing. In this guide, I'll walk you through setting up CRC on Ubuntu, sharing some tips and tricks I learned along the way.&lt;/p&gt;

&lt;h2&gt;
  
  
  System Requirements
&lt;/h2&gt;

&lt;p&gt;Before we begin, ensure your system meets these minimum requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ubuntu Linux (20.04 or newer)&lt;/li&gt;
&lt;li&gt;9GB RAM (16GB recommended for better performance)&lt;/li&gt;
&lt;li&gt;4 CPU cores&lt;/li&gt;
&lt;li&gt;35GB free disk space&lt;/li&gt;
&lt;li&gt;Administrative (sudo) access&lt;/li&gt;
&lt;li&gt;Hardware virtualization support (VT-x or AMD-v)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: Prepare Your System
&lt;/h2&gt;

&lt;p&gt;First, let's ensure your system has the necessary virtualization support. Open a terminal and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Update package list&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update

&lt;span class="c"&gt;# Install KVM and libvirt&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;qemu-kvm libvirt-daemon libvirt-daemon-system

&lt;span class="c"&gt;# Verify KVM installation&lt;/span&gt;
kvm-ok
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;kvm-ok&lt;/code&gt; command should indicate that virtualization is supported and enabled in your BIOS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Install Required Dependencies
&lt;/h2&gt;

&lt;p&gt;CRC needs certain packages to function properly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Install QEMU and virtiofsd&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;qemu-system virtiofsd

&lt;span class="c"&gt;# Add your user to the libvirt group&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;usermod &lt;span class="nt"&gt;-aG&lt;/span&gt; libvirt &lt;span class="nv"&gt;$USER&lt;/span&gt;
newgrp libvirt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Download and Install CRC
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Download the latest CRC from &lt;a href="https://developers.redhat.com/products/openshift-local/overview" rel="noopener noreferrer"&gt;Red Hat's Developer portal&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Extract and install the binary:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Extract the archive&lt;/span&gt;
&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-xvf&lt;/span&gt; crc-linux-amd64.tar.xz

&lt;span class="c"&gt;# Move binary to your PATH&lt;/span&gt;
&lt;span class="nb"&gt;sudo mv &lt;/span&gt;crc-linux-&lt;span class="k"&gt;*&lt;/span&gt;/crc /usr/local/bin/

&lt;span class="c"&gt;# Make it executable&lt;/span&gt;
&lt;span class="nb"&gt;sudo chmod&lt;/span&gt; +x /usr/local/bin/crc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 4: Setup and Start CRC
&lt;/h2&gt;

&lt;p&gt;Now we're ready to set up and start CRC:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Run initial setup&lt;/span&gt;
crc setup

&lt;span class="c"&gt;# Start the cluster&lt;/span&gt;
crc start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The setup process will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configure network settings&lt;/li&gt;
&lt;li&gt;Set up the libvirt network&lt;/li&gt;
&lt;li&gt;Configure the system for virtualization&lt;/li&gt;
&lt;li&gt;Download the OpenShift bundle if needed&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Common Issues and Solutions
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Virtualization Error
&lt;/h3&gt;

&lt;p&gt;If you see errors about virtualization, ensure it's enabled in your BIOS/UEFI settings.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Memory Issues
&lt;/h3&gt;

&lt;p&gt;Default memory allocation might not be enough. Adjust it with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;crc config &lt;span class="nb"&gt;set &lt;/span&gt;memory 16384  &lt;span class="c"&gt;# Sets memory to 16GB&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Network Configuration
&lt;/h3&gt;

&lt;p&gt;If you encounter network issues, try:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;crc cleanup
crc setup
crc start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Useful Commands
&lt;/h2&gt;

&lt;p&gt;Here are some helpful commands for managing your CRC installation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Stop the cluster&lt;/span&gt;
crc stop

&lt;span class="c"&gt;# Delete the cluster&lt;/span&gt;
crc delete

&lt;span class="c"&gt;# View cluster status&lt;/span&gt;
crc status

&lt;span class="c"&gt;# Get console URL and credentials&lt;/span&gt;
crc console &lt;span class="nt"&gt;--credentials&lt;/span&gt;

&lt;span class="c"&gt;# Clean up CRC installation&lt;/span&gt;
crc cleanup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Working with the Cluster
&lt;/h2&gt;

&lt;p&gt;Once your cluster is running, you can:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Access the OpenShift web console using the URL provided&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;oc&lt;/code&gt; commands to interact with the cluster&lt;/li&gt;
&lt;li&gt;Deploy applications using &lt;code&gt;oc new-app&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Use the integrated container registry&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Tips for Better Performance
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Allocate more resources if available:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;crc config &lt;span class="nb"&gt;set &lt;/span&gt;memory 16384
crc config &lt;span class="nb"&gt;set &lt;/span&gt;cpus 6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Enable nested virtualization if available:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;crc config &lt;span class="nb"&gt;set &lt;/span&gt;enable-nested-virtualization &lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Use the built-in monitoring tools to keep track of resource usage:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;crc console &lt;span class="nt"&gt;--credentials&lt;/span&gt;
&lt;span class="c"&gt;# Then access the monitoring dashboard in the OpenShift console&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;CRC provides a fantastic way to run OpenShift locally for development and testing. While the initial setup might seem daunting, following these steps should get you up and running smoothly.&lt;/p&gt;

&lt;p&gt;Remember that CRC is designed for development and testing - it's not meant for production workloads. However, it provides most OpenShift features you need for development, making it an invaluable tool in your development workflow.&lt;/p&gt;

&lt;p&gt;Have you set up CRC on your system? What challenges did you face? Share your experiences in the comments below!&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Note: The commands and steps in this guide were tested on Ubuntu 24.04 LTS, but should work on other Ubuntu versions as well.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>openshift</category>
      <category>ubuntu</category>
      <category>crc</category>
    </item>
    <item>
      <title>🚀Setting Up Local OpenShift Development Environment with Minishift</title>
      <dc:creator>Khuram Murad</dc:creator>
      <pubDate>Fri, 03 Jan 2025 18:08:09 +0000</pubDate>
      <link>https://dev.to/khurammurad/setting-up-local-openshift-development-environment-with-minishift-prerequisites-1n08</link>
      <guid>https://dev.to/khurammurad/setting-up-local-openshift-development-environment-with-minishift-prerequisites-1n08</guid>
      <description>&lt;p&gt;Prerequisites 📋&lt;/p&gt;

&lt;p&gt;Windows/Linux/macOS 💻&lt;br&gt;
VirtualBox installed 🔧&lt;br&gt;
Administrator privileges 🔑&lt;br&gt;
Stable internet connection 🌐&lt;/p&gt;

&lt;p&gt;Installing Minishift ⚙️&lt;br&gt;
Add to System PATH 🛣️&lt;/p&gt;

&lt;p&gt;Download &lt;a href="https://github.com/minishift/minishift/releases/tag/v1.16.1" rel="noopener noreferrer"&gt;https://github.com/minishift/minishift/releases/tag/v1.16.1&lt;/a&gt; 📥&lt;br&gt;
Extract to C:\minishift 📂&lt;br&gt;
Add to PATH:&lt;br&gt;
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\minishift", "Machine")&lt;br&gt;
Or via GUI:&lt;/p&gt;

&lt;p&gt;System Properties → Environment Variables → PATH → Edit ⚡&lt;br&gt;
Add C:\minishift → OK ✅&lt;/p&gt;

&lt;p&gt;Configure Environment 🔨&lt;/p&gt;

&lt;h1&gt;
  
  
  Clean existing setup
&lt;/h1&gt;

&lt;p&gt;minishift delete --force&lt;/p&gt;

&lt;h1&gt;
  
  
  Configure VM settings
&lt;/h1&gt;

&lt;p&gt;minishift config set vm-driver virtualbox&lt;br&gt;
minishift config set memory 4GB&lt;br&gt;
minishift config set cpus 2&lt;br&gt;
minishift config set image-caching true&lt;br&gt;
minishift config set insecure-registry "172.30.0.0/16"&lt;/p&gt;

&lt;h1&gt;
  
  
  Start cluster
&lt;/h1&gt;

&lt;p&gt;minishift start --openshift-version v3.7.0 --iso-url centos&lt;br&gt;
Troubleshooting 🔍&lt;br&gt;
Common Issues &amp;amp; Solutions 🛠️&lt;/p&gt;

&lt;p&gt;Image Pull Failures 🏷️&lt;/p&gt;

&lt;p&gt;CentOS ISO prevents Docker image issues&lt;br&gt;
Insecure registry fixes SSL/TLS problems&lt;/p&gt;

&lt;p&gt;Performance Tips ⚡&lt;/p&gt;

&lt;p&gt;4GB RAM minimum&lt;br&gt;
2 CPUs recommended&lt;br&gt;
Enable image caching&lt;/p&gt;

&lt;p&gt;Best Practices 💡&lt;/p&gt;

&lt;p&gt;Stop cluster: minishift stop&lt;br&gt;
Complete cleanup: minishift delete&lt;br&gt;
Regular configuration backups 💾&lt;br&gt;
Monitor resource usage 📊&lt;/p&gt;

&lt;p&gt;Benefits 🌟&lt;/p&gt;

&lt;p&gt;Free local development environment 💰&lt;br&gt;
Quick testing iterations ⚡&lt;br&gt;
Production-like setup 🎯&lt;br&gt;
Perfect for learning OpenShift 📚&lt;/p&gt;

&lt;p&gt;Verification Steps ✅&lt;/p&gt;

&lt;p&gt;Launch web console via provided URL 🌐&lt;br&gt;
Login with default credentials 🔐&lt;br&gt;
Check cluster health: minishift status 💪&lt;/p&gt;

&lt;p&gt;Success Indicators 🎯&lt;/p&gt;

&lt;p&gt;Web console accessible&lt;br&gt;
Cluster status: Running&lt;br&gt;
No error messages in logs&lt;/p&gt;

&lt;p&gt;Tags 🏷️&lt;/p&gt;

&lt;h1&gt;
  
  
  OpenShift #DevOps #Kubernetes #CloudNative #TechBlog #ContainerPlatform
&lt;/h1&gt;

&lt;p&gt;Found this helpful? Like and share to help others in the community! 🤝&lt;br&gt;
Feel free to reach out with questions or suggestions in the comments below! 💭&lt;/p&gt;

</description>
      <category>alnafi</category>
      <category>openshift</category>
      <category>localsetups</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>How to Install WhatsApp on Linux Using Snapd as WhatsDesk: A Complete Guide</title>
      <dc:creator>Khuram Murad</dc:creator>
      <pubDate>Mon, 04 Nov 2024 03:04:36 +0000</pubDate>
      <link>https://dev.to/khurammurad/how-to-install-whatsapp-on-linux-using-whatsdesk-via-snap-a-complete-guide-2afa</link>
      <guid>https://dev.to/khurammurad/how-to-install-whatsapp-on-linux-using-whatsdesk-via-snap-a-complete-guide-2afa</guid>
      <description>&lt;p&gt;Are you a Linux user looking for a way to use &lt;strong&gt;WhatsApp&lt;/strong&gt; without constantly reaching for your phone? While there isn’t an official WhatsApp app for Linux, you can still install and run it easily with &lt;strong&gt;WhatsDesk&lt;/strong&gt;, an Electron-based application that brings WhatsApp Web to your desktop. In this guide, I’ll show you how to set up WhatsApp on Linux using &lt;strong&gt;Snap&lt;/strong&gt;, a universal package management system that makes installation simple across Linux distros.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Use Snap for Installing Apps on Linux?
&lt;/h3&gt;

&lt;p&gt;Before diving into the installation, let’s talk about &lt;strong&gt;Snap&lt;/strong&gt; and why it’s a great choice for Linux users. Snap is a &lt;strong&gt;cross-distro package manager&lt;/strong&gt; developed by Canonical, allowing applications to run across different Linux distributions without compatibility issues. Snap packages automatically bundle dependencies, which means you get a seamless installation experience without missing library errors.&lt;/p&gt;

&lt;h4&gt;
  
  
  Benefits of Snap for Linux Users
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Universal Compatibility&lt;/strong&gt;: Runs on most Linux distributions, including Ubuntu, Fedora, Debian, and Arch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automatic Updates&lt;/strong&gt;: Snap keeps your applications up-to-date with minimal user intervention.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced Security&lt;/strong&gt;: Snap apps are sandboxed, which helps isolate each app for added security.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step-by-Step Guide: How to Install WhatsApp on Linux with WhatsDesk via Snap
&lt;/h3&gt;

&lt;p&gt;Ready to get started? Follow these simple steps to set up WhatsApp on Linux using WhatsDesk.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 1: Install Snap (if it’s not installed)
&lt;/h4&gt;

&lt;p&gt;Snap comes pre-installed on some Linux distributions, like Ubuntu. However, if it’s missing, you can easily install it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="c"&gt;# On Ubuntu/Debian-based systems&lt;/span&gt;
   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;snapd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="c"&gt;# On Fedora&lt;/span&gt;
   &lt;span class="nb"&gt;sudo &lt;/span&gt;dnf &lt;span class="nb"&gt;install &lt;/span&gt;snapd
   &lt;span class="nb"&gt;sudo ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; /var/lib/snapd/snap /snap
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="c"&gt;# On Arch-based systems&lt;/span&gt;
   &lt;span class="nb"&gt;sudo &lt;/span&gt;pacman &lt;span class="nt"&gt;-S&lt;/span&gt; snapd
   &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl &lt;span class="nb"&gt;enable&lt;/span&gt; &lt;span class="nt"&gt;--now&lt;/span&gt; snapd.socket
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After installation, reboot if needed to ensure everything works smoothly.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 2: Install WhatsDesk Using Snap
&lt;/h4&gt;

&lt;p&gt;Now, let’s install WhatsDesk, a desktop client that lets you use WhatsApp Web in a standalone application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;snap &lt;span class="nb"&gt;install &lt;/span&gt;whatsdesk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command downloads and installs WhatsDesk. Once complete, you’ll find it in your applications menu.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 3: Link WhatsDesk to Your WhatsApp Account
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Open WhatsDesk to display a &lt;strong&gt;QR code&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Open WhatsApp on your mobile device and navigate to &lt;strong&gt;Settings &amp;gt; Linked Devices&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Tap &lt;strong&gt;Link a Device&lt;/strong&gt; and scan the QR code shown in WhatsDesk.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Congratulations! You can now use WhatsApp on your Linux desktop.&lt;/p&gt;




&lt;h3&gt;
  
  
  Important Note: WhatsDesk is Essentially WhatsApp Web in a Standalone App
&lt;/h3&gt;

&lt;p&gt;Since &lt;strong&gt;WhatsDesk&lt;/strong&gt; is an Electron-based wrapper, it’s essentially &lt;strong&gt;WhatsApp Web&lt;/strong&gt; running as a standalone application. Here are some pros and cons to consider:&lt;/p&gt;

&lt;h4&gt;
  
  
  Pros
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Lightweight and Easy to Use&lt;/strong&gt;: There’s no complex setup—just scan and go.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Standalone Application&lt;/strong&gt;: No need to keep a browser tab open.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automatic Updates&lt;/strong&gt;: With Snap, you always have the latest version without manual updates.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Cons
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Limited Features&lt;/strong&gt;: Some WhatsApp features available on mobile might not work.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Final Thoughts on Using WhatsApp on Linux with WhatsDesk
&lt;/h3&gt;

&lt;p&gt;Running &lt;strong&gt;WhatsApp on Linux&lt;/strong&gt; is easier than ever, thanks to Snap and apps like WhatsDesk. This setup is ideal for Linux users who prefer a native-like experience without keeping a browser tab open. As Snap expands, more applications will become universally accessible, making Linux a more versatile OS.&lt;/p&gt;

&lt;p&gt;If you’ve set up WhatsDesk for WhatsApp on Linux or have questions about Snap, drop a comment below! This guide should help you get the most out of WhatsApp on your Linux setup.&lt;/p&gt;

</description>
      <category>whatsapp</category>
      <category>alnafi</category>
      <category>linux</category>
      <category>snapd</category>
    </item>
    <item>
      <title>Writing Terraform Configurations</title>
      <dc:creator>Khuram Murad</dc:creator>
      <pubDate>Sun, 03 Nov 2024 11:23:15 +0000</pubDate>
      <link>https://dev.to/khurammurad/writing-terraform-configurations-a-beginners-guide-4b6b</link>
      <guid>https://dev.to/khurammurad/writing-terraform-configurations-a-beginners-guide-4b6b</guid>
      <description>&lt;p&gt;This guide will walk you through writing effective Terraform configurations. Terraform, developed by HashiCorp, lets you manage infrastructure as code. Using HashiCorp Configuration Language (HCL), it allows you to describe resources in a clear, human-readable way. I’ll cover HCL basics, resource definitions, variables, outputs, and using modules for reusable components.&lt;/p&gt;

&lt;h4&gt;
  
  
  Understanding HashiCorp Configuration Language (HCL)
&lt;/h4&gt;

&lt;p&gt;HCL is the backbone of Terraform. It’s designed to be easy to read and write, with a straightforward syntax for configuring infrastructure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basic Syntax:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
HCL uses blocks, arguments, and expressions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_instance"&lt;/span&gt; &lt;span class="s2"&gt;"example"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;ami&lt;/span&gt;           &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ami-123456"&lt;/span&gt;
  &lt;span class="nx"&gt;instance_type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"t2.micro"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Blocks&lt;/strong&gt; define objects (like resources or providers).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Arguments&lt;/strong&gt; assign values to block properties.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expressions&lt;/strong&gt; represent values, including references to other resources.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Variables and Outputs
&lt;/h4&gt;

&lt;p&gt;Variables make your configuration flexible, while outputs let you extract specific data from your resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example of Variables and Outputs:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"instance_type"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"EC2 instance type"&lt;/span&gt;
  &lt;span class="nx"&gt;default&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"t2.micro"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"instance_ip"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;example&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;public_ip&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Defining Resources
&lt;/h4&gt;

&lt;p&gt;Resources represent infrastructure components, and they’re essential in any Terraform configuration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Basic Resource Definition:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_instance"&lt;/span&gt; &lt;span class="s2"&gt;"my_instance"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;ami&lt;/span&gt;           &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ami&lt;/span&gt;
  &lt;span class="nx"&gt;instance_type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;instance_type&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Resource Dependencies:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Terraform detects dependencies between resources to handle creation order. Explicit dependencies can be defined using &lt;code&gt;depends_on&lt;/code&gt;.&lt;/p&gt;
&lt;h4&gt;
  
  
  Using Variables for Flexibility
&lt;/h4&gt;

&lt;p&gt;Variables make configurations reusable and customizable.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Declaring Variables:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;  &lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"region"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Deployment region"&lt;/span&gt;
    &lt;span class="nx"&gt;default&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"us-west-2"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Using Variables:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;  &lt;span class="nx"&gt;provider&lt;/span&gt; &lt;span class="s2"&gt;"aws"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;region&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;var&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;region&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h4&gt;
  
  
  Passing Variables in Terraform and Their Precedence
&lt;/h4&gt;

&lt;p&gt;Terraform provides multiple ways to pass variables, each with a specific order of precedence:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;CLI Arguments:&lt;/strong&gt; &lt;code&gt;terraform apply -var="instance_type=t2.micro"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Environment Variables:&lt;/strong&gt; &lt;code&gt;export TF_VAR_instance_type=t2.micro&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;terraform.tfvars File&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Auto-Loaded *.auto.tfvars Files&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Variable Defaults in Configuration&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;
  
  
  Outputs: Extracting Information
&lt;/h4&gt;

&lt;p&gt;Outputs let you access information from resources, useful for interfacing with other tools.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"public_ip"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;my_instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;public_ip&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Modules: Promoting Reusability
&lt;/h4&gt;

&lt;p&gt;Modules are collections of resources that can be reused.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Creating a Module:&lt;/strong&gt; Define resources in a separate directory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Using a Module:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;  &lt;span class="nx"&gt;module&lt;/span&gt; &lt;span class="s2"&gt;"webserver_module"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;source&lt;/span&gt;       &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"./modules/webserver"&lt;/span&gt;
    &lt;span class="nx"&gt;ami&lt;/span&gt;          &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"ami-123456"&lt;/span&gt;
    &lt;span class="nx"&gt;instance_type&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"t2.micro"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Best Practices for Terraform Configurations
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Organize Resources:&lt;/strong&gt; Group related resources in the same file or module.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use Variables and Outputs Wisely:&lt;/strong&gt; Define variables for frequently changed elements and outputs for key information.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Format and Validate Code:&lt;/strong&gt; Use &lt;code&gt;terraform fmt&lt;/code&gt; to format and &lt;code&gt;terraform validate&lt;/code&gt; to check for errors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Document Configurations:&lt;/strong&gt; Add comments and document variables and outputs for clarity.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By following these tips and understanding these basics, you’ll be on your way to writing effective Terraform configurations. Whether managing a small setup or a large infrastructure, Terraform, with best practices, makes it easier to achieve your goals efficiently and with control.&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>alnafi</category>
      <category>aws</category>
    </item>
    <item>
      <title>Setting Up Terraform with AWS: A Beginner's Guide</title>
      <dc:creator>Khuram Murad</dc:creator>
      <pubDate>Wed, 30 Oct 2024 12:25:01 +0000</pubDate>
      <link>https://dev.to/khurammurad/setting-up-terraform-with-aws-a-beginners-guide-14fp</link>
      <guid>https://dev.to/khurammurad/setting-up-terraform-with-aws-a-beginners-guide-14fp</guid>
      <description>&lt;p&gt;Managing infrastructure can get complex, especially as your cloud footprint grows. Luckily, Terraform, an open-source Infrastructure as Code (IaC) tool, makes it simpler by automating the deployment and management of your infrastructure on AWS. In this guide, we’ll walk through the essentials of setting up Terraform with AWS, from configuring your credentials and setting up a basic project to implementing best practices like remote state storage and managing secrets securely. Let’s dive in!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why Use Terraform with AWS?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Terraform’s integration with AWS provides a powerful, scalable solution for managing infrastructure. Here are some key benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Automation and Efficiency&lt;/strong&gt;: By automating infrastructure provisioning, Terraform reduces manual work and errors.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability&lt;/strong&gt;: Scaling your infrastructure up or down based on demand is straightforward.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Version Control&lt;/strong&gt;: Using IaC, you can track changes and revert to previous states if necessary.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;1. Configuring AWS Provider Credentials&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To get started, you’ll need to set up credentials so Terraform can access your AWS account to create, update, and delete resources.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Creating an IAM User&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Log in to your &lt;strong&gt;AWS Management Console&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Go to &lt;strong&gt;Identity and Access Management (IAM)&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Create a new IAM user with &lt;strong&gt;programmatic access&lt;/strong&gt;, which will give you an &lt;strong&gt;access key ID&lt;/strong&gt; and a &lt;strong&gt;secret access key&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Pro Tip&lt;/strong&gt;: Store your credentials securely. Using environment variables (&lt;code&gt;AWS_ACCESS_KEY_ID&lt;/code&gt; and &lt;code&gt;AWS_SECRET_ACCESS_KEY&lt;/code&gt;) instead of hardcoding them directly in code is a recommended practice.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Configuring the AWS Provider in Terraform&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Define your AWS provider settings in Terraform by creating a simple &lt;code&gt;provider&lt;/code&gt; block in your configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;provider&lt;/span&gt; &lt;span class="s2"&gt;"aws"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;region&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"us-east-1"&lt;/span&gt;
  &lt;span class="nx"&gt;access_key&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"your_access_key_here"&lt;/span&gt;
  &lt;span class="nx"&gt;secret_key&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"your_secret_key_here"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For improved security, you can omit the access key and secret key here by setting them in environment variables instead. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;2. Setting Up a Basic Terraform Project&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A typical Terraform project is organized into files with specific roles to keep configurations modular and maintainable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;main.tf&lt;/strong&gt;: This file contains your main configuration code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;variables.tf&lt;/strong&gt;: This file declares variables to make your code more dynamic and reusable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;outputs.tf&lt;/strong&gt;: Here, you define outputs that you might want to display or pass to other configurations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here’s an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="c1"&gt;# main.tf&lt;/span&gt;
&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_s3_bucket"&lt;/span&gt; &lt;span class="s2"&gt;"my_bucket"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;bucket&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"my-unique-bucket-name"&lt;/span&gt;
  &lt;span class="nx"&gt;acl&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"private"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# variables.tf&lt;/span&gt;
&lt;span class="nx"&gt;variable&lt;/span&gt; &lt;span class="s2"&gt;"region"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;description&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"The AWS region"&lt;/span&gt;
  &lt;span class="nx"&gt;default&lt;/span&gt;     &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"us-east-1"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# outputs.tf&lt;/span&gt;
&lt;span class="nx"&gt;output&lt;/span&gt; &lt;span class="s2"&gt;"bucket_name"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;aws_s3_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;my_bucket&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;3. Configuring Backend for Remote State Storage&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Terraform keeps track of your infrastructure state, which is essential for collaborative work and storing sensitive information securely.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Configuring an S3 Backend&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Using S3 as a backend for your Terraform state allows you to share it across your team and provides a backup. Add this configuration to your project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;terraform&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;backend&lt;/span&gt; &lt;span class="s2"&gt;"s3"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;bucket&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"my-terraform-state-bucket"&lt;/span&gt;
    &lt;span class="nx"&gt;key&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"state"&lt;/span&gt;
    &lt;span class="nx"&gt;region&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"us-east-1"&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the S3 backend, any changes to the infrastructure state will be saved and versioned automatically in the bucket.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;4. Managing Sensitive Data with AWS Secrets Manager&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;It’s important not to hardcode sensitive data (like database passwords or API keys) into your Terraform files. AWS Secrets Manager can help here by securely storing secrets.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Integrating AWS Secrets Manager with Terraform&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Here’s how you can retrieve secrets from AWS Secrets Manager in your Terraform configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="s2"&gt;"aws_secretsmanager_secret_version"&lt;/span&gt; &lt;span class="s2"&gt;"my_secret"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;secret_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"my_secret_name"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_db_instance"&lt;/span&gt; &lt;span class="s2"&gt;"my_database"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;# other configuration...&lt;/span&gt;
  &lt;span class="nx"&gt;password&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;aws_secretsmanager_secret_version&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;my_secret&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;secret_string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, Terraform retrieves the database password from Secrets Manager, keeping your sensitive data secure and out of the configuration files.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Setting up Terraform with AWS provides a powerful framework for efficiently managing cloud infrastructure as code. By following these practices—like using IAM roles for access, remote state storage, and securely managing sensitive data—you’ll establish a robust, scalable, and secure foundation for your infrastructure management. Now you’re ready to explore Terraform’s more advanced features to enhance your AWS setup even further!&lt;/p&gt;

&lt;p&gt;Feel free to leave comments or questions below. Let’s build a resilient infrastructure together!&lt;/p&gt;

</description>
      <category>alnafi</category>
      <category>aws</category>
      <category>devops</category>
      <category>terraform</category>
    </item>
    <item>
      <title>Step-by-Step Guide for Setting Up Nextcloud with GDPR Compliance</title>
      <dc:creator>Khuram Murad</dc:creator>
      <pubDate>Sat, 26 Oct 2024 08:00:37 +0000</pubDate>
      <link>https://dev.to/khurammurad/step-by-step-guide-for-setting-up-nextcloud-with-gdpr-compliance-164i</link>
      <guid>https://dev.to/khurammurad/step-by-step-guide-for-setting-up-nextcloud-with-gdpr-compliance-164i</guid>
      <description>&lt;h3&gt;
  
  
  Objective
&lt;/h3&gt;

&lt;p&gt;To set up a secure data storage and sharing system using Nextcloud for GDPR compliance, including data retention policies, encryption, and Two-Factor Authentication (2FA).&lt;/p&gt;




&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Operating System&lt;/strong&gt;: Ubuntu (server or desktop)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Root Privileges&lt;/strong&gt;: Ensure you have sudo access&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Step 1: Update System and Install Required Dependencies
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Update your system&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install Apache, MariaDB, and PHP 7.4&lt;/strong&gt;:
Since PHP 7.4 is not available by default in recent Ubuntu repositories, add a PPA for older PHP versions.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;add-apt-repository ppa:ondrej/php
   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install PHP 7.4 and necessary extensions&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;apache2 mariadb-server libapache2-mod-php7.4 php7.4 php7.4-mysql php7.4-xml php7.4-mbstring php7.4-zip php7.4-gd php7.4-curl php7.4-intl php7.4-bz2 php7.4-json php7.4-sqlite3 php7.4-opcache &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 2: Set Up MariaDB for Nextcloud
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Secure the MariaDB installation&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Follow the prompts to set up a secure configuration.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Create a Database and User for Nextcloud&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;mysql &lt;span class="nt"&gt;-u&lt;/span&gt; root &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the MariaDB prompt, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;   &lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;nextcloud&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;USER&lt;/span&gt; &lt;span class="s1"&gt;'nextclouduser'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'localhost'&lt;/span&gt; &lt;span class="n"&gt;IDENTIFIED&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="s1"&gt;'yourpassword'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;ALL&lt;/span&gt; &lt;span class="k"&gt;PRIVILEGES&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;nextcloud&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="s1"&gt;'nextclouduser'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'localhost'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="n"&gt;FLUSH&lt;/span&gt; &lt;span class="k"&gt;PRIVILEGES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
   &lt;span class="n"&gt;EXIT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 3: Download and Configure Nextcloud
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Download Nextcloud&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   wget https://download.nextcloud.com/server/releases/nextcloud-21.0.1.zip
   unzip nextcloud-21.0.1.zip
   &lt;span class="nb"&gt;sudo mv &lt;/span&gt;nextcloud /var/www/html/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Set Permissions for Nextcloud&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; www-data:www-data /var/www/html/nextcloud
   &lt;span class="nb"&gt;sudo chmod&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; 755 /var/www/html/nextcloud
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 4: Set Up Apache Virtual Host for Nextcloud
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Create a new Apache configuration file&lt;/strong&gt; for Nextcloud:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/apache2/sites-available/nextcloud.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Add the following configuration&lt;/strong&gt; (use &lt;code&gt;localhost&lt;/code&gt; for a local setup):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight apache"&gt;&lt;code&gt;   &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nl"&gt;VirtualHost&lt;/span&gt;&lt;span class="sr"&gt; *:80&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;       &lt;span class="nc"&gt;DocumentRoot&lt;/span&gt; /var/www/html/nextcloud
       &lt;span class="nc"&gt;ServerName&lt;/span&gt; localhost

       &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nl"&gt;Directory&lt;/span&gt;&lt;span class="sr"&gt; /var/www/html/nextcloud/&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;           &lt;span class="nc"&gt;AllowOverride&lt;/span&gt; &lt;span class="ss"&gt;All&lt;/span&gt;
           &lt;span class="nc"&gt;Require&lt;/span&gt; &lt;span class="ss"&gt;all&lt;/span&gt; granted
       &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nl"&gt;Directory&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;
       &lt;span class="nc"&gt;ErrorLog&lt;/span&gt; ${APACHE_LOG_DIR}/nextcloud_error.log
       &lt;span class="nc"&gt;CustomLog&lt;/span&gt; ${APACHE_LOG_DIR}/nextcloud_access.log combined
   &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nl"&gt;VirtualHost&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Enable the new configuration and required Apache modules&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;a2ensite nextcloud.conf
   &lt;span class="nb"&gt;sudo &lt;/span&gt;a2enmod rewrite headers &lt;span class="nb"&gt;env dir &lt;/span&gt;mime
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Restart Apache&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart apache2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 5: Ensure PHP 7.4 is Enabled in Apache
&lt;/h2&gt;

&lt;p&gt;If multiple PHP versions are installed, ensure Apache is using PHP 7.4.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Disable any higher PHP versions (if enabled)&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;a2dismod php8.3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Enable PHP 7.4&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;a2enmod php7.4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Restart Apache&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart apache2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 6: Complete Nextcloud Setup in the Browser
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Open Nextcloud in your browser&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;code&gt;http://localhost&lt;/code&gt; or &lt;code&gt;http://yourdomain.com&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Follow the setup wizard&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Create an admin account&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Specify the data directory&lt;/strong&gt; (e.g., &lt;code&gt;/var/www/html/nextcloud/data&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enter database details&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Database user&lt;/strong&gt;: &lt;code&gt;nextclouduser&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database password&lt;/strong&gt;: The password you set&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database name&lt;/strong&gt;: &lt;code&gt;nextcloud&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database host&lt;/strong&gt;: &lt;code&gt;localhost&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Finish Setup&lt;/strong&gt; to complete the installation.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Step 7: Apply GDPR Compliance Settings
&lt;/h2&gt;

&lt;h3&gt;
  
  
  A. Configure Data Retention Policies
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install the Retention App&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;strong&gt;Settings&lt;/strong&gt; &amp;gt; &lt;strong&gt;Apps&lt;/strong&gt; &amp;gt; &lt;strong&gt;Admin&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enable the &lt;strong&gt;File Retention&lt;/strong&gt; app if available.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Define Retention Policies&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;strong&gt;Settings&lt;/strong&gt; &amp;gt; &lt;strong&gt;Administration&lt;/strong&gt; &amp;gt; &lt;strong&gt;Workflow&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Set up file retention rules (e.g., automatic deletion of old files).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  B. Enable Server-Side Encryption
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Enable the Default Encryption Module&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;strong&gt;Settings&lt;/strong&gt; &amp;gt; &lt;strong&gt;Apps&lt;/strong&gt; &amp;gt; &lt;strong&gt;Security&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enable &lt;strong&gt;Default Encryption Module&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Enable Server-Side Encryption&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;strong&gt;Settings&lt;/strong&gt; &amp;gt; &lt;strong&gt;Administration&lt;/strong&gt; &amp;gt; &lt;strong&gt;Security&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enable &lt;strong&gt;Server-Side Encryption&lt;/strong&gt; under the Encryption settings.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  C. Enable Two-Factor Authentication (2FA)
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Install the Two-Factor TOTP Provider App&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;strong&gt;Settings&lt;/strong&gt; &amp;gt; &lt;strong&gt;Apps&lt;/strong&gt; &amp;gt; &lt;strong&gt;Security&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enable &lt;strong&gt;Two-Factor TOTP Provider&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Set Up 2FA for User Accounts&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;strong&gt;Settings&lt;/strong&gt; &amp;gt; &lt;strong&gt;Security&lt;/strong&gt; in your user profile.&lt;/li&gt;
&lt;li&gt;Follow the setup process to link your account with a 2FA app (e.g., Google Authenticator).&lt;/li&gt;
&lt;li&gt;Admins can enforce 2FA for all users under &lt;strong&gt;Administration&lt;/strong&gt; &amp;gt; &lt;strong&gt;Security&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Installed Dependencies&lt;/strong&gt;: Apache, MariaDB, PHP 7.4 with necessary modules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configured MariaDB&lt;/strong&gt;: Created a database and user for Nextcloud.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set Up Nextcloud&lt;/strong&gt;: Downloaded, configured, and installed Nextcloud.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Applied GDPR Compliance&lt;/strong&gt;: Configured data retention, enabled encryption, and set up 2FA.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Your Nextcloud setup is now fully operational with GDPR compliance for secure data management. Let me know if you need further assistance!&lt;/p&gt;

</description>
      <category>alnafi</category>
      <category>nextcloud</category>
      <category>datasecurity</category>
    </item>
  </channel>
</rss>
