Linux user without home KodeKloud Engineer Task Success

Ticker

6/recent/ticker-posts

Linux user without home KodeKloud Engineer Task Success

Question :  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 Server 1 in Stratos Datacenter.

Create a user named javed in App Server 1 without a home directory



 Please Note :-  Perform the below commands based on your question  server,  user name & other details might differ . So please read task carefully before executing. All the Best 👍

Solution:  

1. At first login on app server given in task & Switch to  root user 

thor@jump_host /$ ssh tony@stapp01

The authenticity of host 'stapp01 (172.16.238.10)' can't be established.

ECDSA key fingerprint is SHA256:RIRt2SqEVQ3yKDQ+cX5QLPw7mJNJhXUcT5Dpsy4GU1U.

ECDSA key fingerprint is MD5:bd:f7:14:9e:c0:fd:41:0d:2d:e4:30:47:8a:34:35:ae.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added 'stapp01,172.16.238.10' (ECDSA) to the list of known hosts.

tony@stapp01's password:

[tony@stapp01 ~]$ sudo su -

 We trust you have received the usual lecture from the local System

Administrator. It usually boils down to these three things:

     #1) Respect the privacy of others.

    #2) Think before you type.

    #3) With great power comes great responsibility.

 [sudo] password for tony:

[root@stapp01 ~]#

3. Check user javed is existed , if not then proceed with creation

[root@stapp01 ~]# id javed

id: mohammed: no such user

[root@stapp01 ~]# cat /etc/passwd |grep javed

[root@stapp01 ~]#

4. create a user javed with below commands ( check user name in your task)     

[root@stapp01 ~]# useradd -M javed

[root@stapp01 ~]#


5.  Validate the task by listing the file exist in  Home directory   

[root@stapp01 ~]# id javed

uid=1002(javed) gid=1002(javed) groups=1002(javed)

[root@stapp01 ~]#

[root@stapp01 ~]# cat /etc/passwd |grep javed

javed:x:1002:1002::/home/javed:/bin/bash

[root@stapp01 ~]#

[root@stapp01 ~]# ll /home

total 8

drwx------ 1 ansible ansible 4096 Oct 15  2019 ansible

drwx------ 1 tony    tony    4096 Jan 25  2020 tony

[root@stapp01 ~]#

6. Click on Finish & Confirm to complete the task successful

Happy Learning!!!!


Apart from this if you need more clarity,  I have made a  tutorial video on this , 

please go through and share your comments. Like and share the knowledge





Post a Comment

0 Comments

Latest Posts

KodeKloud Kubernetes Security CKS  Lab Challenge 4 |  Audit-policy | Install & configure falco utility | Inspect the API server audit logs and identify the user