Uploaded by Faiz Ali Shah

Hussnain OS Lab 5.pdf

advertisement
NAME:
Hussnain Arshad
SAP ID:
70068110
COURSE:
OPERATING SYSTEMS (LAB)
DEPARTMENT OF SOFTWARE ENGINEERING
This study source was downloaded by 100000855323782 from CourseHero.com on 10-27-2022 23:28:56 GMT -05:00
https://www.coursehero.com/file/95248106/Hussnain-OS-Lab-5pdf/
LAB#5
1: Add a user ‘uol1’ and show default directory of this
user.
umair@umair-linux:~$ sudo useradd uol1
[sudo] password for umair:
umair@umair-linux:~$ pwd
/home/umair
2: Add a user ‘uol2’ and the default directory of this user
should be /home/admin
umair@umair-linux:~$ sudo useradd -m uol2
umair@umair-linux:~$ ls -la /home/uol2/
total 34
drwxr-xr-x 4 uol2 uol2 4096 Mar 18 14:07 .
drwxr-xr-x 4 root root 4096 Mar 18 14:07 ..
-rw-r--r-- 1 uol2 uol2 220 Feb 25 2020 .bash_logout
-rw-r--r-- 1 uol2 uol2 3771 Feb 25 2020 .bashrc
drwxr-xr-x 5 uol2 uol2 4096 Jan 3 21:33 .config
-rw-r--r-- 1 uol2 uol2 22 Sep 8 2011 .gtkrc-2.0
-rw-r--r-- 1 uol2 uol2 516 Dec 18 2013 .gtkrc-xfce
drwxr-xr-x 3 uol2 uol2 4096 Jan 3 21:33 .local
-rw-r--r-- 1 uol2 uol2 807 Feb 25 2020 .profile
3: Add a user ‘uol3’ and give this user a default password.
Now switch to ‘uol3’ and change the password of ‘uol3’.
umair@umair-linux:~$ sudo useradd uol3
umair@umair-linux:~$ sudo passwd uol3
New password:
Retype new password:
This study source was downloaded by 100000855323782 from CourseHero.com on 10-27-2022 23:28:56 GMT -05:00
https://www.coursehero.com/file/95248106/Hussnain-OS-Lab-5pdf/
passwd: password updated successfully
4: lock the user ‘uol3’ and try to login from this user.
umair@umair-linux:~$ usermod -L uol3
usermod: Permission denied.
usermod: cannot lock /etc/passwd; try again later.
umair@umair-linux:~$ sudo usermod -L uol3
umair@umair-linux:~$ su -l uol3
Password:
su: Authentication failure
5: Unlock the user ‘uol3’ and try to login from this user
again.
umair@umair-linux:~$ usermod -U uol3
usermod: Permission denied.
usermod: cannot lock /etc/passwd; try again later.
umair@umair-linux:~$ sudo usermod -U uol3
6: Add ‘terminal’ to your taskbar (shortcut).
7: Add a user ‘uol4’ and give this user a default password.
Now enforce the user to change the password within 2
months.
umair@umair-linux:~$ sudo useradd -e 2021-04-01 uol4
8: Give a warning to ‘uol4’ before 5 days of ending date of
changing the password.
umair@umair-linux:~$ sudo chage -W 5 uol4
9: Show the general information regarding Q7 and Q8 on
your terminal.
umair@umair-linux:~$ sudo chage -l uol4
Last password change
This study source was downloaded by 100000855323782 from CourseHero.com on 10-27-2022 23:28:56 GMT -05:00
https://www.coursehero.com/file/95248106/Hussnain-OS-Lab-5pdf/
: Mar 18, 2021
Password expires
: never
Password inactive
: never
Account expires
: Apr 01, 2021
Minimum number of days between password change
:0
Maximum number of days between password change
: 99999
Number of days of warning before password expires
:7
10: Add expiry date (01 December 2017) to the user
‘uol4’.
umair@umair-linux:~$ sudo chage -E 2017-12-01 uol4
[sudo] password for umair:
This study source was downloaded by 100000855323782 from CourseHero.com on 10-27-2022 23:28:56 GMT -05:00
https://www.coursehero.com/file/95248106/Hussnain-OS-Lab-5pdf/
Powered by TCPDF (www.tcpdf.org)
Download