Linux User Adding

LinuxLinuxBeginner
Practice Now

Introduction

In a future where cyber warfare has become the norm, securing communication and protecting data integrity are paramount for every military operation. You are playing the role of an electronic warfare specialist tasked with creating a secure Linux system for an upcoming classified operation. Your primary goal is to configure and maintain user accounts, ensuring that only authorized personnel have access to their own domains of command within the system. The objective is to fortify the system by adding users with appropriate permissions, preparing it for any unforeseen digital threats.


Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL linux(("`Linux`")) -.-> linux/UserandGroupManagementGroup(["`User and Group Management`"]) linux/UserandGroupManagementGroup -.-> linux/useradd("`User Adding`") subgraph Lab Skills linux/useradd -.-> lab-271423{{"`Linux User Adding`"}} end

Creating a New User

In this step, you will learn how to add a new user to the system. User management is crucial in maintaining the security of a Linux system, especially in scenarios requiring compartmentalization of information. We will add a user named "cipher" who will be a part of the cryptography team.

In the zsh terminal, execute the following command to create a new user:

sudo useradd -m -s /bin/bash cipher

Explanation:

  • sudo: Runs commands with superuser privileges.
  • useradd: The command used to add a new user to your system.
  • -m: Creates a home directory for the new user.
  • -s /bin/bash: Defines the default shell for the new user, which is bash in this case.

Make sure that the default working directory is /home/labex/project. After running the command, check if the user has been created by looking into the /home directory and listing the contents:

ls /home

You should see a directory with the name cipher in the list, indicating that the user has been successfully created.

Setting User Password

The next step after adding a user is to assign them a secure password. It is critical in the realm of cyber warfare to ensure all user accounts are protected with strong, non-default passwords.

In this step, you will set a password for the user "cipher". Execute the following command and follow the interactive prompts to set the password:

sudo passwd cipher

Remember to set a strong password that includes a mix of letters, numbers, and special characters.

Once you have set the password, you can verify that it has been updated by checking the /etc/shadow file, where encrypted user passwords are stored. Do not open or share the content of this file as it is sensitive information.

Summary

In this lab, we tackled the fundamental aspect of user management in Linux by adding a new user and setting a password for them. User management forms the backbone of system administration, and through these exercises, you've started on the path to mastering Linux administration. The design of the lab aimed to provide a hands-on experience in a stimulating scenario that reflects real-world applications. Your efforts have contributed to the security and integrity of the system, ensuring preparedness for the frantic world of electronic warfare.

Other Linux Tutorials you may like