Skip to main content

Finding User Account Information from the Command Line

Hands-On Lab

 

Photo of Michael Christian

Michael Christian

Course Development Director in Content

Length

00:30:00

Difficulty

Beginner

In this hands-on lab, we will practice working with users and groups in Linux. Knowing how to determine user attributes and group membership is fundamental to managing Linux systems.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Finding User Account Information from the Command Line

Introduction

In this hands-on lab, we will practice working with users and groups in Linux. Knowing how to determine user attributes and group membership is fundamental to managing Linux systems.

Connecting to the Lab

  1. Open your terminal application, and run the following command (remember to replace PUBLIC_IP with the public IP you were provided on the lab instructions page):
    ssh cloud_user@PUBLIC_IP
  2. Enter yes at the prompt.
  3. Enter your cloud_user password at the prompt.

Determine What Groups sysusr Belongs To

  1. List the current working directory.
    pwd
  2. Run the following command:
    id sysuser
  3. Note the groups values returned in the output.

Determine sysusr’s Home Directory

  1. Run the following command:
    getent passwd sysuser
  2. Note the user's home directory returned in the output.

Determine sysusr’s Login Shell

  1. Run the following command:
    cat /etc/passwd | grep sysusr
  2. Note the login shell returned in the output.

Conclusion

Congratulations, you've successfully completed this hands-on lab!