Question 1. How to set a username and password to never expires ?
Answer: chage -M -1 krishna
Question 2. Why /etc/passwd and /etc/shadow file cannot be merged into one file ?
Answer:
- The existence of the two files is a consequence of that /etc/passwd is a text file that can be read by other applications (as finger, ident or ls for example), so an attacker could gain access to the information of the file that included the hashed password.
- To increase security, the hashed password that used to be in the file was moved to other file called /etc/shadow that is accessible only by root
Question 3 : How to list, all the files opened by particular PID ?
Answer:
- lsof –p PID
- Count number of files & processes
Question 4: We are unable to unmount the file system. What are the reason behind it ?
Answer:
- #you are in the same directory pwd ,
- #some users are present in the directory and using its content fuser -cu /dev/sda,
- #some of the files are open in the directory lsof /dev/sda7
Question 5 : What could be the reason if server take more time after reboot ?
Answer:
- filesystem got corrupt and its ext2,ext2 is not having journaling feature.
Question 6 : we are trying to create the file under any partition but we are getting permission denied alert. What could be the reason? However,
no space issue and no permission issue?
Answer :
- I am running out of inode
- Sometimes, df command reports that there is enough free space but system claims file-system is full.
- You need to check for the inode which identifies the file and its attributes on a file systems using the following command:
- $ df -i
- $ df -i /ftpusers/
- Sample outputs:
- Filesystem Inodes IUsed IFree IUse% Mounted on
- /dev/sda8 6250496 11568 6238928 1% /ftpusers
- So /ftpusers has 62,50,496 total inodes but only 11,568 are used. You are free to create another 62,38,928 files on /ftpusers partition.
- If 100% of your inodes are used, try the following options:
- Find unwanted files and delete or move to another server.
Find unwanted large files and delete or move to another server
please provide realtime interview qns and ans file
Noted. Work in progress soon you the Linux 100+ interview Questions and Answers in this site