New Colleague System Account Setup

LinuxLinuxBeginner
Practice Now

Introduction

In this project, you will learn how to set up a new user account for a new colleague named Jane on the LabEx testing server. You will create the user account, set the home directory, change the default shell to zsh, and grant sudo privileges to the new user.

🎯 Tasks

In this project, you will learn:

  • How to create a new user account
  • How to set the home directory for a user
  • How to change the default shell for a user
  • How to grant sudo privileges to a user

🏆 Achievements

After completing this project, you will be able to:

  • Manage user accounts on a Linux system
  • Customize user account settings, such as the home directory and default shell
  • Grant administrative privileges to user accounts as needed
  • Perform basic user account administration tasks on a testing or development server

Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL linux(("`Linux`")) -.-> linux/UserandGroupManagementGroup(["`User and Group Management`"]) linux/UserandGroupManagementGroup -.-> linux/usermod("`User Modifying`") linux/UserandGroupManagementGroup -.-> linux/sudo("`Privilege Granting`") subgraph Lab Skills linux/usermod -.-> lab-301483{{"`New Colleague System Account Setup`"}} linux/sudo -.-> lab-301483{{"`New Colleague System Account Setup`"}} end

Create a New User Account for Jane

In this step, you will learn how to create a new user account for Jane on the LabEx testing server.

  1. Open a terminal and run the following command to create a new user account for Jane:
sudo adduser jane

This command will prompt you to enter a password for the new user account and some additional information. Enter the required information as prompted.

  1. Verify that the new user account has been created successfully by running the following command:
ls -l /home

You should see the new /home/jane directory, indicating that the new user account has been created.

Set the Home Directory for Jane

In this step, you will learn how to set the home directory for the new Jane user account.

  1. Run the following command to set the home directory for the Jane user account:
sudo usermod -d /home/jane jane

This command sets the home directory for the jane user to /home/jane.

  1. Verify that the home directory has been set correctly by running the following command:
grep jane /etc/passwd

The output should show the home directory as /home/jane.

Set the Default Shell for Jane

In this step, you will learn how to set the default shell for the Jane user account to zsh.

  1. Run the following command to set the default shell for the Jane user account to zsh:
sudo usermod -s /bin/zsh jane

This command sets the default shell for the jane user to /bin/zsh.

  1. Verify that the default shell has been set correctly by running the following command:
grep jane /etc/passwd

The output should show the default shell as /bin/zsh.

Grant Sudo Privileges to Jane

In this step, you will learn how to grant sudo privileges to the Jane user account.

  1. Run the following command to add the Jane user to the sudo group:
sudo usermod -aG sudo jane

This command adds the jane user to the sudo group, granting them sudo privileges.

  1. Verify that the Jane user has been added to the sudo group by running the following command:
groups jane

The output should include the sudo group, indicating that the Jane user has been granted sudo privileges.

Congratulations! You have successfully completed the setup of the new user account for Jane on the LabEx testing server.

Summary

Congratulations! You have completed this project. You can practice more labs in LabEx to improve your skills.

Other Linux Tutorials you may like