Question : For security reasons the xFusionCorp Industries security team has decided to use custom Apache users for each web application hosted, rather than its default user. This will be theApache user, so it shouldn't use the default home directory. Create the user as per requirements given below:
a. Create a user named yousuf on the App server 1 in Stratos Datacenter.
b. Set UID to 1128 and its home directory to /var/www/yousuf.
1. Login on app server as per the 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:G4hE4jjizKnDulV/G1nuw2Q7Jd8RXdccXG/HR7mGxe4. ECDSA key
fingerprint is MD5:79:93:6b:e2:f5:bc:47:92:f0:f2:5d:73:46:ca:6b:f0. 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
~]# |
2. Run the Below command to create a new user yousuf with UID
( Note - check user name & ID in your task)
[root@stapp01
~]# useradd -u 1128 yousuf [root@stapp01
~]# [root@stapp01
~]# id yousuf uid=1128(yousuf)
gid=1128(yousuf) groups=1128(yousuf) [root@stapp01
~]# [root@stapp01
~]# cat /etc/passwd |grep yousuf yousuf:x:1128:1128::/home/yousuf:/bin/bash [root@stapp01
~]# |
3. Post user creation run Below command to change user home directory.
Refer mine youtube video for more details ( check home directory in your task)
[root@stapp01
~]# usermod -d /var/www/yousuf -m yousuf [root@stapp01
~]# [root@stapp01
~]# cat /etc/passwd |grep yousuf yousuf:x:1128:1128::/var/www/yousuf:/bin/bash [root@stapp01
~]# |
4. Click on Finish & Confirm to complete the task successfully
Happy Learning!!!!
2 Comments
asking for password after the SSH command.what to do now?
ReplyDeleteFor ssh particular user and server login credentials refer in the link https://www.nbtechsupport.co.in/2022/08/kodekloud-servers-login-credentials.html
Delete