Unit 1 - Moving into admin Flashcards
What does it mean that Linux is a file-based system?
Everything in linux is either a file or directory.
What does a file become when it is executed? And can they also be seen as a file?
A process.
And yes that can also be seen as a file in the ‘proc’ directory.
What does the /bin directory contain?
Contains commands that the user can run but will also be used by system as well during the boot process.
What does /boot directory contain?
Contains everything needed during boot process.
What does /dev directory contain?
Contains directory for devices.
What does /home directory contain?
Contains user files.
What does the /tmp directory contain?
It contains temporary files for User’s and System.
What does the /var directory contain?
System files that can change.
What does the /etc directory contain?
System files that do not change.
What does the /lib directory contain?
Stores sytem libraries.
What does the /proc directory contain?
Files which represent the running system. (process info pseudo system)
What does the /sbin directory contain?
Commands only used by admin.
What does the /usr directory contain?
Commands never used during boot-up.
What are the four files that user details are stored in?
- /etc/passwd - User details
- /etc/shadow - User password
- /etc/groups - Group details
- /etc/gshadow - Group password
What do you see when you do cat /etc/passwd?
- 7 Columns
1) Username
2) x
3) UID
4) GID
5) Finger info
6) Home directory
7) Log-in shell
What do you see when you do head -3 /etc/shadow?
userName:PasswordMD5Hashed:
What do you see when you look inside /etc/group?
userName:x:GID:AnotherOtherUsersAdded
What do you see when you look inside /etc/gshadow?
groupName:x:
What does the ‘cut’ command do and what are the options -d” “ and -f used for?
The cut command is used to chop lines.
- -d is used to set a delimiter
- -f is used to specify a column
What command do you use to change ownership?
chown .
What command do you use to change group ownership?
chgrp
What does the ‘.’ immediately after file permissions in an ls -l output indicate?
That there are alternative methods of access to file/directory.
SELinux security context
What does the ‘+’ immediately after file permissions in an ls -l output indicate?
There are a combination of access methods.
What does the numerical value following the permission show?
The number of hard links there exists to the file.
What does ‘getfacl’ do?
It displays the access list for the specified file.
How is the default permissions set?
They are set using a ‘umask’ value which is taken away from 777.
What is the command used to create a hard link to a file?
ln
What is the command used to create a soft link to a file?
ln -s
If you delete the source hard link file does the new hard link file still remain? Is this different in soft link files?
With hard link files they still remain but with softlink files they do not.
If a change is made to a linked file is this change reflected in the source file and vice versa?
Yes.
What is another word for soft link?
Symbolic Link.
What is the difference between hard link and soft link?
Hard links point to the actual block in memory whereas soft links point to original file which point to actual block in memory.
What is a daemon?
A process started upon booting which runs in the background.
Discussion question.
Future of file permission:
–Is User/Group/Other sufficient?
–Simple control methods? ACL…
–Complex control methods? SELinux