<?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: Syam Sarosa</title>
    <description>The latest articles on DEV Community by Syam Sarosa (@syamsarosa).</description>
    <link>https://dev.to/syamsarosa</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%2F961468%2F971cb3c5-5e0a-464c-b0fe-ff87ef2f862f.jpeg</url>
      <title>DEV Community: Syam Sarosa</title>
      <link>https://dev.to/syamsarosa</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/syamsarosa"/>
    <language>en</language>
    <item>
      <title>Ubuntu 24.04 NVIDIA Upgrade Error</title>
      <dc:creator>Syam Sarosa</dc:creator>
      <pubDate>Fri, 06 Dec 2024 08:35:16 +0000</pubDate>
      <link>https://dev.to/syamsarosa/ubuntu-2404-upgrade-error-pmh</link>
      <guid>https://dev.to/syamsarosa/ubuntu-2404-upgrade-error-pmh</guid>
      <description>&lt;p&gt;Recently, I upgraded my Ubuntu from 22.04 to 24.04. The upgrade process went smoothly. However, I get the result below when I check the Ubuntu version using the &lt;code&gt;lsb_release -a&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04.1 LTS
Release:    24.04
Codename:   noble
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But the next day, things went wrong.  &lt;/p&gt;

&lt;p&gt;When I powered on my laptop, I left it to grab coffee. Ten minutes later—just a blank, black screen. Even after waiting longer, nothing changed. I had to force shutdown and try again.  &lt;/p&gt;

&lt;p&gt;This cycle repeated. On my third attempt, I observed the boot process. In the boot menu (I use dual boot), I selected &lt;strong&gt;Advanced Options for Ubuntu&lt;/strong&gt;, chose an older kernel (&lt;code&gt;5.15.0-124&lt;/code&gt;), and it booted normally.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F81wgkt3bxpfghet4temi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F81wgkt3bxpfghet4temi.png" alt="Ubuntu Windows dual boot" width="755" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Debugging the Issue
&lt;/h3&gt;

&lt;p&gt;The first thing I do is try to fix any dpkg error 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;sudo &lt;/span&gt;dpkg &lt;span class="nt"&gt;--configure&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It failed. So, I try to update and upgrade the package manually 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;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Failed again. After checking the error carefully, I found below error&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Building module:
Cleaning build area...
&lt;span class="nb"&gt;unset &lt;/span&gt;ARCH&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="nt"&gt;-h&lt;/span&gt; /usr/bin/cc &lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;CC&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/bin/gcc&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;env &lt;/span&gt;&lt;span class="nv"&gt;NV_VERBOSE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="s1"&gt;'make'&lt;/span&gt; &lt;span class="nt"&gt;-j8&lt;/span&gt; &lt;span class="nv"&gt;NV_EXCLUDE_BUILD_MODULES&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;''&lt;/span&gt; &lt;span class="nv"&gt;KERNEL_UNAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;6.8.0-49-generic IGNO
&lt;span class="nv"&gt;RE_XEN_PRESENCE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="nv"&gt;IGNORE_CC_MISMATCH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="nv"&gt;SYSSRC&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/lib/modules/6.8.0-49-generic/build &lt;span class="nv"&gt;LD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/bin/ld.bfd &lt;span class="nv"&gt;CONFIG_X86_KERNEL_IBT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; modules............&lt;span class="o"&gt;(&lt;/span&gt;bad ex
it status: 2&lt;span class="o"&gt;)&lt;/span&gt;
ERROR: Cannot create report: &lt;span class="o"&gt;[&lt;/span&gt;Errno 17] File exists: &lt;span class="s1"&gt;'/var/crash/nvidia-dkms-450-server.0.crash'&lt;/span&gt;
Error! Bad &lt;span class="k"&gt;return &lt;/span&gt;status &lt;span class="k"&gt;for &lt;/span&gt;module build on kernel: 6.8.0-49-generic &lt;span class="o"&gt;(&lt;/span&gt;x86_64&lt;span class="o"&gt;)&lt;/span&gt;
Consult /var/lib/dkms/nvidia-srv/450.248.02/build/make.log &lt;span class="k"&gt;for &lt;/span&gt;more information.
dkms autoinstall on 6.8.0-49-generic/x86_64 failed &lt;span class="k"&gt;for &lt;/span&gt;nvidia-srv&lt;span class="o"&gt;(&lt;/span&gt;10&lt;span class="o"&gt;)&lt;/span&gt;
Error! One or more modules failed to &lt;span class="nb"&gt;install &lt;/span&gt;during autoinstall.
Refer to previous errors &lt;span class="k"&gt;for &lt;/span&gt;more information.
 &lt;span class="k"&gt;*&lt;/span&gt; dkms: autoinstall &lt;span class="k"&gt;for &lt;/span&gt;kernel 6.8.0-49-generic
   ...fail!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;nvidia-dkms-450-server.0.crash&lt;/code&gt; peak my interest. After some Google search, I found the solution.&lt;/p&gt;

&lt;p&gt;First, I remove it using the below command.&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 remove dkms nvidia-dkms-450-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, I execute &lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade&lt;/code&gt; again&lt;/p&gt;

&lt;p&gt;Next, I tried to install &lt;code&gt;nvidia-dkms-450-server&lt;/code&gt; again but failed because the package was unavailable. The error message shows the new package that replaces 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;apt &lt;span class="nb"&gt;install &lt;/span&gt;nvidia-kernel-common-450-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The next thing I do is remove all unused packages using &lt;code&gt;sudo apt autoremove&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Finally, I reboot my laptop. It boots up normally. Below is the kernel version that I use (I check it using &lt;code&gt;uname -a&lt;/code&gt; command).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3bg1zls2qf86jn9wi86u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3bg1zls2qf86jn9wi86u.png" alt="Ubuntu Kernel 6.8x uname -r result" width="167" height="42"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>nvidia</category>
      <category>linux</category>
    </item>
    <item>
      <title>Laravel Mastery #1 | Install and run your first Laravel project</title>
      <dc:creator>Syam Sarosa</dc:creator>
      <pubDate>Mon, 02 Dec 2024 02:33:46 +0000</pubDate>
      <link>https://dev.to/syamsarosa/laravel-mastery-install-and-run-your-first-laravel-project-3n8b</link>
      <guid>https://dev.to/syamsarosa/laravel-mastery-install-and-run-your-first-laravel-project-3n8b</guid>
      <description>&lt;p&gt;Welcome to the &lt;strong&gt;Laravel Mastery&lt;/strong&gt; series! Whether you're familiar with Laravel or just exploring it, this guide will help you set up Laravel and run your first project locally. Let’s dive into this step-by-step tutorial and get you started with Laravel, the PHP framework loved by developers worldwide.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This tutorial series isn’t just about building applications—it’s about unlocking the "why" behind the "how." Imagine having the confidence to tackle any project, no matter how unique, because you deeply understand the core principles of Laravel. Master these concepts, and you won’t just build apps—you’ll create efficient, bug-free, and easy-to-maintain solutions that make you a standout developer. Ready to level up and leave the competition behind? Let’s dive in!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why Choose Laravel?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Laravel isn’t just another PHP framework—it’s a complete toolkit for building modern web applications.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Elegant Syntax&lt;/strong&gt;: Write clean and maintainable code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Powerful CLI&lt;/strong&gt;: Automate tasks using Artisan, Laravel’s command-line tool.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extensibility&lt;/strong&gt;: Leverage official and third-party packages.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility&lt;/strong&gt;: Build APIs, integrate front-end frameworks, or create robust full-stack applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're ready to enhance your development experience, Laravel is the way to go.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Getting Started: What You Need&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Before jumping into Laravel, ensure your system is equipped with the essentials:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;PHP 8.1+&lt;/strong&gt;
Check your PHP version by running:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Composer&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Composer is a dependency manager for PHP, essential for Laravel installation. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;A Web Server (Optional)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
While Laravel has a built-in development server, Apache or Nginx can be useful for production-like setups.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;A Database (Optional for Now)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Laravel supports multiple databases, but you won’t need one for this guide.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Installing Composer&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Composer simplifies the management of Laravel’s dependencies. Let’s set it up:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Download Composer&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Visit the &lt;a href="https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos" rel="noopener noreferrer"&gt;Composer installation guide&lt;/a&gt; and follow the steps for your OS.  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Verify Installation&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Run:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   composer &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you see the below result, you’re good to go.&lt;br&gt;
   &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnzflw06q58mjmkeo3x6j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnzflw06q58mjmkeo3x6j.png" alt="Composer version" width="467" height="139"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Installing Laravel&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;With Composer installed, you’re ready to bring Laravel into your development environment.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install the Laravel Installer&lt;/strong&gt;
Run this command to globally install the Laravel Installer:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   composer global require laravel/installer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Verify Installation&lt;/strong&gt;
Check the Laravel Installer version with:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   laravel &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;You should see the Laravel Installer version listed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3yovijpf4gigshymxpvh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3yovijpf4gigshymxpvh.png" alt="Laravel Installer version" width="218" height="27"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;strong&gt;Creating Your First Laravel Project&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Time to create and explore your first Laravel project!  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Create a New Project&lt;/strong&gt;
Use the Laravel Installer to set up your project:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   laravel new awesome-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If you didn’t install the Laravel Installer, you can use Composer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   composer create-project laravel/laravel awesome-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Navigate to Your Project Directory&lt;/strong&gt;
Move into the project folder:
&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;cd &lt;/span&gt;awesome-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Running Laravel Locally&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Laravel’s built-in development server makes running your project simple.  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Start the Development Server&lt;/strong&gt;
From your project directory, execute:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   php artisan serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Access Your Application&lt;/strong&gt;
Open your browser and visit:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   http://localhost:8000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You’ll see Laravel’s welcome page—congratulations, you’re live!  &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Running Laravel on a Web Server&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;For a more traditional setup, you can use a web server like Apache or Nginx. Here’s how to configure Apache:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Move Your Project to the Web Server’s Public Directory&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On Linux: &lt;code&gt;/var/www/html&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;On Windows (XAMPP): &lt;code&gt;/xampp/htdocs&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Access Your Application&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Visit your browser and go to:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   http://localhost/awesome-app/public
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  &lt;strong&gt;Next Steps&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Congratulations! You’ve successfully installed Laravel and run your first project. This foundational step sets the stage for exploring Laravel’s advanced features, like routing, controllers, and views.  &lt;/p&gt;

&lt;p&gt;In the next article of the &lt;strong&gt;Laravel Mastery&lt;/strong&gt; series, we’ll build something incredible together. Stay tuned—it’s going to be a fun and enlightening journey!  &lt;/p&gt;

</description>
      <category>laravel</category>
      <category>webdev</category>
      <category>php</category>
    </item>
    <item>
      <title>How to create a sudo user</title>
      <dc:creator>Syam Sarosa</dc:creator>
      <pubDate>Sat, 12 Oct 2024 08:33:09 +0000</pubDate>
      <link>https://dev.to/syamsarosa/how-to-create-a-sudo-user-27m2</link>
      <guid>https://dev.to/syamsarosa/how-to-create-a-sudo-user-27m2</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;When you create a new Linux server, you will first use the root user. The root user is an administrative Linux user with the highest privileges. When you use it, you can make any changes, even very destructive changes.&lt;/p&gt;

&lt;p&gt;Due to its highest privileges and account availability in all Linux OS, the root account is one of the main attack targets. Because of that, it's &lt;em&gt;discouraged&lt;/em&gt; to use the root account regularly.&lt;/p&gt;

&lt;p&gt;This tutorial will explain what is a sudo user, how to create a normal user, and make it a sudo user for regular use.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Sudo User?
&lt;/h2&gt;

&lt;p&gt;A sudo (short for "superuser do") is a command that allows a normal user to execute administrative tasks, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install and delete application&lt;/li&gt;
&lt;li&gt;Change OS and application config&lt;/li&gt;
&lt;li&gt;Grant users or groups of users the ability to run certain commands&lt;/li&gt;
&lt;li&gt;so on.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If something breaks, you can find all commands and arguments executed using sudo in &lt;code&gt;/var/log/auth.log&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;A sudo user is a normal user that can execute a sudo command. To do this, you must add the normal user to the &lt;strong&gt;sudo&lt;/strong&gt; system group.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;To follow along with this tutorial, you will need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Linux server with root access.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you have this, log in to the server using SSH as root. &lt;/p&gt;

&lt;h2&gt;
  
  
  Conventions
&lt;/h2&gt;

&lt;p&gt;For consistency, this tutorial uses the following conventions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This tutorial will create a new user called &lt;strong&gt;syam&lt;/strong&gt;, but you should replace that with your real username.&lt;/li&gt;
&lt;li&gt;Command beginning with &lt;code&gt;#&lt;/code&gt; is executed by root.&lt;/li&gt;
&lt;li&gt;Command beginning with &lt;code&gt;$&lt;/code&gt; is executed by a normal or sudo user.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;When you create a user, Linux will ask for a password. Follow these tips to create a secure password.&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Use a combination of numbers, uppercase, lowercase, and symbol&lt;/li&gt;
&lt;li&gt;Password is at least 16 characters in length&lt;/li&gt;
&lt;li&gt;Use a password manager to generate a long random password and save it.&lt;/li&gt;
&lt;li&gt;Use unique password&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Create a Sudo User on Debian &amp;amp; Ubuntu
&lt;/h2&gt;

&lt;p&gt;You can add a new user in Debian &amp;amp; Ubuntu OS using the below command:&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;# adduser syam&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will be asked a few questions, such as password, full name, room number, and so on. Enter a strong password. The rest of the questions are optional, you can fill in any additional information that you like. You can skip any question by pressing the &lt;strong&gt;ENTER&lt;/strong&gt; button.&lt;/p&gt;

&lt;p&gt;Now, you have a new user account with regular privileges. This account cannot run administrative tasks as the root user yet. To do it, you can change your new user account into a &lt;em&gt;superuser&lt;/em&gt; by giving it root privileges. These privileges will allow your new user account to run the administrative task by putting the word &lt;code&gt;sudo&lt;/code&gt; before the command.&lt;/p&gt;

&lt;p&gt;To change your new user account into a &lt;em&gt;superuser&lt;/em&gt;, run the below command as root (substitute the username syam with your actual user account):&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;# usermod -aG sudo syam&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can now run administrative commands using your new user account. To verify it, switch to your new user.&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;# su syam&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, try to run administrative tasks such as updating your package repository. Type your password (for security reasons, your server won't show anything when you type it). Once done, press &lt;code&gt;ENTER&lt;/code&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="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create a Sudo User on FreeBSD
&lt;/h2&gt;

&lt;p&gt;Once you're logged in as root, you need to install &lt;code&gt;sudo&lt;/code&gt; because &lt;br&gt;
The new FreeBSD server comes with minimal requirements for it to operate. Before you can use the &lt;code&gt;sudo&lt;/code&gt; command, you need to install it. You can install &lt;code&gt;sudo&lt;/code&gt; from the port collection.&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;# cd /usr/ports/security/sudo/&lt;/span&gt;
&lt;span class="c"&gt;# make install clean&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alternatively, you can install the &lt;code&gt;sudo&lt;/code&gt;  package using pkg. If pkg is not installed, FreeBSD will ask for permission to install it. Press &lt;strong&gt;y&lt;/strong&gt; and then &lt;strong&gt;ENTER&lt;/strong&gt; to 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;# pkg install sudo&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, create a new user using the below command. Remember to change syam with your actual user.&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;# adduser syam&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer all the questions asked. Remember to type in a strong password. Besides the password, all the questions are optional. You can skip it by pressing the &lt;strong&gt;ENTER&lt;/strong&gt; button.&lt;/p&gt;

&lt;p&gt;Next, add the user you just created to the wheel group. This group limits who can use &lt;code&gt;sudo&lt;/code&gt; to become root.&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;# pw group mod wheel -m syam&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once done, you need to edit the sudoers file. Since it's a core file, always use &lt;code&gt;visudo&lt;/code&gt; when you edit it. The &lt;code&gt;visudo&lt;/code&gt; utility will check and warn you if there's an error in the sudoers file before saving it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# visudo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Never edit &lt;code&gt;/etc/sudoers&lt;/code&gt; directly because errors in the sudoers file can break your system. Always use &lt;code&gt;visudo&lt;/code&gt; to do it. The &lt;code&gt;visudo&lt;/code&gt; utility will do syntax checking and inform you if there's any error before saving your changes to the sudoers file.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After that, look for the wheel group. Remove the &lt;code&gt;#&lt;/code&gt; to enable it. It should look like this after you remove the &lt;code&gt;#&lt;/code&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="c"&gt;## Allows people in group wheel to run all commands&lt;/span&gt;
%wheel  &lt;span class="nv"&gt;ALL&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt;ALL&lt;span class="o"&gt;)&lt;/span&gt;       ALL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To exit vi, press &lt;strong&gt;ESC&lt;/strong&gt;, then followed by &lt;code&gt;:wq&lt;/code&gt;, then press &lt;strong&gt;ENTER&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Finally, switch to the sudo user you just created.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Try to run administrative tasks using the sudo user.&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;pkg update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create a Sudo User on Rocky Linux
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Coming soon ...&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>security</category>
    </item>
  </channel>
</rss>
