QUE 1) :- RECOVER ROOT PASSWORD.
1)Root password troubleshooting.
A)To lock the root user.
#usermod -L root
*To check the shadow file.
#vim /etc/shadow
root:!$1$aFq8TCs5$3kaiGxWtCSTNIt7RvQFRP0:14218:0:99999:7:::
A)ANS :-To unlock the root user.
#usermod -U root
root:$1$aFq8TCs5$3kaiGxWtCSTNIt7RvQFRP0:14218:0:99999:7:::
#head -1 /etc/shadow
root:$1$aFq8TCs5$3kaiGxWtCSTNIt7RvQFRP0:14218:0:99999:7:::
last 2 field should be empty.
#chage -l root
Password expires : never
Password inactive : never
Account expires : never
this 3 should be never.
B)*password is not set hence no login.
#vim /etc/shadow
root:!!:14218:0:99999:7:::
ANS:- to set password.
#passwd
#vim /etc/shadow
root:$1$23urSrMw$NDcR939aR9hUMEJB4Z6rZ.:14279:0:99999:7:::
(We can use single user mode to change the password.)
C)In this file 2 field should have (x)
#head -1 /etc/passwd
root:!!:0:0:root:/root:/bin/bash
ANS :-change as follows.
#vim /etc/passwd
root:x:0:0:root:/root:/bin/bash
D)Check login shell.
It should contain a valid shell path.
root:x:0:0:root:/root:/sbin/false
root:x:0:0:root:/root:/sbin/nologin
root:x:0:0:root:/root:/dev/zero
root:x:0:0:root:/root:/dev/null
ANS is :- change the shell to a valid one
root:x:0:0:root:/root:/bin/bash
E)TO check valid shells prefer.
#vim /etc/shells
check /etc/securetty
#vim /etc/securetty
no lines should be commented.
To check the permissions of /etc/securetty
#ls -l /etc/securetty
-rw------- 1 root root 122 Feb 4 21:54 /etc/securetty
permission should be 600.If something else then correct it.
4)EXAMPLE :-
Foult.
#chmod 777 /etc/securetty
#ls -l /etc/securetty
-rwxrwxrwx 1 root root 122 Feb 4 21:54 /etc/securetty
Solution.
#chmod 600 /etc/securetty
-rw------- 1 root root 122 Feb 4 21:54 /etc/securetty
############################################
QUE 3) :- DIG PROBLEM
Dig problem.
1)Add DNS server ip in /etc/resolv.conf
ANS :-
#vim /etc/resolv.conf
nameserver (server ip)
how to fet the DNS server ip?
1)network.txt file --given by examiner in system.
2)
###########################################
QUE 4) :- DISK QUOTA
*Disk Quotas problems.
1)To create the users.
#useradd neo
2)To assigne quota
#vim /etc/fstab
LABEL=/home /home ext3 defaults,usrquota,grpquota 1 2
#mount -o remount,usrquota,grpquota /home/
3)to check
#mount
4)To create quota files.
#quotacheck -cugv /home
5)To switchon the quota.
#quotaon /home/
6)To check the quota.
#repquota -a
7)To assigne the quota.
#edquota -u (user)neo
Disk quotas for user neo (uid 706):
Filesystem blocks soft hard inodes soft hard
/dev/sda7 16 0 70 6 0 0
8)To login by user.
#su - neo
$dd if=/dev/zero of=/home/neo/somefile bs=70k count=1
$ll -h
$quota -v
$rm -f somefile
##############################################
QUE 5) :- LVM
Resize lv upto 500mb.
200mb to 500mb.
first to check the space is availabel in Volume Group for resize the lv.
If no space so first create the partition & convert that partition into pv & add into vg.
If space is availabel so go for the lvresize.
1)To create partition.
#fdisk /dev/sda
*To create partition.
2)To update the partition table.
#partprobe /dev/sda
3)To create physical volume.
#pvcreate /dev/sda12
Physical volume "/dev/sda12" successfully created
4)To create volume group.
#vgextend vg0 /dev/sda12
Volume group "vg0" successfully created
5)To resize the Logical Volume.
#lvresize -L +300mb /dev/vg0/lvm1
Extending logical volume raj to 300.00 MB
Logical volume raj successfully resized
6)To check.
#lvdisplay
############# END ################
By Laxman D. Kadam.
Ph No:- 9967413230
Email:- vikasjk3@gmail.com
No comments:
Post a Comment