Answer for KodeKloud Question - Add a user without a home directory.

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. They are finished with all apps except for App 3 in Stratos Datacenter.


Create a user named Anita in App Server 3 without a home directory.


Answer : 

ssh <user>@app03
sudo su

useradd -M anita 

#To verify 

cd /home 
ls - lrth
 
 (there will be no home directory listed for anita but it will be presented in ect/passwrd)

cat /etc/passwd | grep anita

Note: Commands are correct but based on your question the server and user name might differ so please do check.

check below video too for how to do the task (i have done a sample task on  Ubuntu OS)



No comments:

Post a Comment

Featured Post

Answer for Kodekloud DEVOPS Questions - Init container in Kubernetes

Question: 1. Create a Deployment named as ic-deploy-devops. 2. Configure spec as replicas should be 1 , labels app should be ic-devops , ...