User creation for service account

Create a user named john in App Server 3 without a home directory.
Note: You can find the infrastructure details by clicking on the Details of all Users and Servers button on the top-right section of the page.

i have tried sudo useradd -M john and sudo useradd -M -d / john

but anything not worked and throwing me error

  • home directory should not be allocated to user ‘john’ on App Server 3

  • Curriculum: Linux Basics / System Administration
  • Level: Beginner (Foundation Level)
  • Task Name:
    “Create a Service User”

4

Service User Creation without Home Directory

from 100days of devops

This appears to be a KodeKloud Engineer question. Could you please include either:

  • The curriculum, level and task name if it’s regular KKE, OR
  • The “day” if it’s “100 days of devops”

Thanks!

A good way to approach this kind of problem is to do a web search. If you do this, you’ll find that you need to use the command useradd -M USERNAME, since -M will prevent a home directory from being created. See this post for a bit more detail.