Comprehensive Guide to Booting Artix on a UEFI-Enabled Virtual Machine #Part 2

Comprehensive Guide to Booting Artix on a UEFI-Enabled Virtual Machine #Part 2

This Article is continuation of : Comprehensive Guide to Booting Artix on a UEFI-Enabled Virtual Machine #Part1

usermod --append --groups wheel kintsugi        

The command you provided uses a different syntax to achieve the same goal as the previous usermod -aG wheel kintsugi command. Here's a detailed breakdown:

  1. usermod: This command is used to modify user account settings.
  2. --append: This option appends the user to the supplementary groups specified by the --groups option. It ensures that the user is added to the new groups without being removed from any existing groups.
  3. --groups wheel: This option specifies the supplementary group(s) to which the user will be added. In this case, the wheel group is specified. The wheel group typically grants sudo privileges, allowing its members to execute commands as the superuser using sudo.
  4. kintsugi: This is the username of the user account being modified.


in Vim, Editor (X is for delete,I is for insert,Esc and then write :wq to save and quit)

visudo        

The visudo command is used to safely edit the sudoers file, which controls the permissions for users to execute commands as the superuser or other users. Here’s how to use visudo and what it does:

  1. Runs visudo: visudo opens the sudoers file located at /etc/sudoers in the default text editor (usually vi or nano), but in a special mode that performs syntax checking when you save the file. This prevents syntax errors that could lock you out of superuser access.
  2. Syntax Checking: After editing, visudo checks the file for syntax errors. If it detects any errors, it will prompt you to fix them before allowing you to exit, preventing misconfiguration that could lead to system issues.

To grant the wheel group sudo privileges, you can follow these steps after running visudo:

Open sudoers file: Run the visudo command:

visudo        

  • Locate the line for wheel group: Find the following line in the file:
  • # %wheel ALL=(ALL:ALL) ALL
  • Uncomment the line: Remove the # at the beginning to uncomment the line, allowing members of the wheel group to use sudo:
  • %wheel ALL=(ALL:ALL) ALL
  • Save and exit: Save your changes and exit the editor. In vi, you would do this by pressing Esc, then typing :wq and pressing Enter.

Go Down at Bottom of Config file
Enable %wheel ALL = (ALL) ALL
Enable %sudo ALL = (ALL) ALL
find root line and write YourUserName ALL = (ALL) ALL

The line ALL=(ALL:ALL) ALL in the sudoers file defines the sudo privileges for a specific user or group. Let's break down what each part of this line means:


  • ALL: The first ALL specifies which hosts the rule applies to. In most cases, it is set to ALL to allow the rule to apply to any host.
  • (ALL:ALL): This part specifies the users and groups that the user can run commands as:
  • ALL: The second ALL (outside the parentheses) specifies which commands the user is allowed to run. In this case, it means the user can run any command.

Putting it all together, ALL=(ALL:ALL) ALL means:

  • The rule applies to all hosts.
  • The user can run commands as any user and any group.
  • The user can run all commands.

When you see this line in the sudoers file, it effectively grants the specified user or group full sudo privileges, allowing them to execute any command as any user or group on the system.

Here’s an example of how this might look in context within the sudoers file:

%wheel ALL=(ALL:ALL) ALL

This line means that any user in the wheel group can execute any command as any user or group on the system.

su -username        

The su -username command is used to switch to a different user account in a Unix-like operating system. Here's how it works and what it does:

  1. Switch User: The su command stands for "substitute user" or "switch user." It allows you to switch to another user account.
  2. - Option: The hyphen (-) option tells su to start a login shell for the specified user. This means it simulates a full login, including loading the user's environment variables, such as PATH and HOME, and changing to the user's home directory. It's equivalent to su -l username.
  3. username: This is the name of the user account you want to switch to.

sudo -lU username        
sudo pacman -Syu
ping google.com
reboot        

sudo pacman -Syu command updates the package database and upgrades all installed packages on an Arch Linux-based system.

  • sudo allows you to run the command with superuser privileges.
  • pacman is the package manager for Arch Linux.
  • -Syu is a combination of options:-S: Synchronize packages (install or update).-y: Refresh the package database.-u: Upgrade all out-of-date packages.


Conclusion: Congratulations! You've successfully set up a UEFI-enabled virtual machine to boot Artix Linux. You've learned how to partition the virtual hard drive correctly and configure the bootloader to boot the stock kernel. Explore further customization options and enjoy using Artix Linux on your virtualized environment!

Compiling and Installing a Custom Kernel on Arch Linux

要查看或添加评论,请登录

Siddhant Bali的更多文章

社区洞察

其他会员也浏览了