Lab activity

Default User Environment

Learn how to configure default Linux user environments using /etc/skel, profile files, aliases, environment variables, and login message settings.

Overview

The default user environment defines the initial settings, files, aliases, and environment variables that users receive when a new Linux account is created. In this lab, you will learn how to configure system-wide and user-specific default environments for new users. You will work with configuration files and directories such as /etc/skel, /etc/profile, /etc/profile.d, /etc/environment, and /etc/motd to customize login behavior, shell settings, aliases, and environment variables in Linux.

In This Lab, You’ll Learn How To

  • Configure default files for new user accounts
  • Customize the /etc/skel directory
  • Add default aliases and welcome messages
  • Create system-wide environment variables
  • Manage login shell configuration files
  • Configure global profile scripts
  • Customize login messages using motd and issue files

Key Configuration Files

  • /etc/skel for default user files
  • .bashrc for shell aliases and commands
  • .profile for login shell settings
  • /etc/profile for system-wide shell configuration
  • /etc/profile.d/ for modular environment scripts
  • /etc/environment for global environment variables
  • /etc/motd and /etc/issue for login messages

Command Examples

View the skeleton directory:

ls -la /etc/skel

Add a default alias to .bashrc:

echo 'alias ll="ls -alh"' >> /etc/skel/.bashrc

Create a system-wide environment variable:

echo 'export COMPANY_ENV=production' > /etc/profile.d/company.sh

Set a global editor variable:

echo 'EDITOR=vim' >> /etc/environment

Update the message of the day:

echo 'Authorised users only.' > /etc/motd

Learning Outcomes

  • Understand how Linux creates default user environments
  • Customize startup files for new users
  • Configure system-wide environment variables
  • Manage login messages and shell behavior
  • Develop practical Linux administration skills

Conclusion

Completing this lab will help you gain practical experience configuring default Linux user environments and system-wide shell settings. You will learn how to provide consistent configurations, aliases, and environment variables for all users on a Linux system. These skills are important for Linux system administration, LFCS preparation, and managing multi-user Linux environments efficiently.