Skip to main content

Lab 004: Linux User Without Home


Requirements

The system admins team of xFusionCorp Industries has set up a new tool on all app servers, as they have a requirement to create a service user account that will be used by that tool.

Create a user named jim in App Server 1 without a home directory.


Note

This lab demonstrates creating a user account without a home directory for system services.

Prerequisites

  • SSH access to App Server 1 with root or sudo privileges.
  • User management tools available (useradd, grep).

Steps

Login to the app server and switch to root. For the server credentials, check out the Project Nautilus documentation.

sshpass -p '*****' ssh -o StrictHostKeyChecking=no tony@172.16.238.10
sudo su -
*****
[root@stapp01 ~]# useradd -M jim
[root@stapp01 ~]#
[root@stapp01 ~]# grep jim /etc/passwd
jim:x:1002:1002::/home/jim:/bin/bash
[root@stapp01 ~]#
[root@stapp01 ~]# su - jim
su: warning: cannot change directory to /home/jim: No such file or directory

Verification

  • Confirm user jim exists with id jim.
  • Confirm no home directory is assigned with grep jim /etc/passwd.
  • Confirm home directory field is empty or /dev/null.

Resources