This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Thursday, September 21, 2017

Linux basics question and answer.

Linux basics question and answer.

1. What is linux?
linux is a free open-source operating system based on unix. Linux is an alternative to the windows operating system. Linux was originally created by linus Torvalds. A student of the university of

Linux has a reputation as a very efficient and fast-performing system. Linux's kernel (the central part of the operating system) was developed by Linus Torvalds at the University of Helsinki in Finland. To complete the operating system, Torvalds and other team members made use of system components developed by members of the Free Software Foundation for the GNU Project.

2. What is OS?

 An operating system is a program that controls the execution of application programs and acts as an interface between the user of a computer and the computer Hardware. In other words “ THE SOFTWARE THAT CONTROLS THE HARDWARE “

3. What is open source operating system ?

 Open source refers to a program or software in which the source code (the form of the program when a programmer writes a program in a particular programming language) is available to the general public for use and/or modification from its original design free of charge.

4. What are the products of RedHat?

 Redhat enterprise linux, cloud computing, Redhat enterprise virtualization, etc.

5. What are different flavors (or distributions) of linux?

 Redhat, Turbolinux, Debian, Ubuntu, Fedora, OpenSUSE, Slackware, mandriva. Etc.

6. Who created unix?

 Ken Thompson in 1969.

7. Who founded open source foundation?

 The Free Software Foundation (FSF) is a nonprofit with a worldwide mission to promote computer user freedom and to defend the rights of all free software users.

8. What is the difference between rhel 4 and rhel 5 ?

difference between RHEL 4 and RHEL 5

1)In RHEL 4 SELinux Block only 13 services, But on RHEL 5 SElinux Block 80 services
2) RHEL 4 have ext2 filesystem, but RHEL 5 we have ext3 filesystem That support Journal
3)RHEL 4 have no virtualization Feature, but in RHEL 5 we have virtualization with Hypervisor-V
4)In RHEL 4 we have no Yum, But in RHEL 5 we have Yum available

( or )

XEN, YUM and improved SELinux
all the features updated with better options
Better GUI support then RHEL4
YUM over RPM package management
IPTables and SELinux for more secure environment

9. Difference bw tcp and udp ?

TCP(Transmission Control Protocol). TCP is a connection-oriented protocol, a connection can be made from client to server, and from then on any data can be sent along that connection.

a) Reliable - when you send a message along a TCP socket, you know it will get there unless the connection fails completely. If it gets lost along the way, the server will re-request the lost part. This means complete integrity, things don't get corrupted.
b) Ordered - if you send two messages along a connection, one after the other, you know the first message will get there first. You don't have to worry about data arriving in the wrong order.
c) Heavyweight - when the low level parts of the TCP "stream" arrive in the wrong order, resend requests have to be sent, and all the out of sequence parts have to be put back together, so requires a bit of work to piece together.

UDP(User Datagram Protocol). A simpler message-based connectionless protocol. With UDP you send messages(packets) across the network in chunks.

a) Unreliable - When you send a message, you don't know if it'll get there, it could get lost on the way.
b) Not ordered - If you send two messages out, you don't know what order they'll arrive in.
c) Lightweight - No ordering of messages, no tracking connections, etc. It's just fire and forget! This means it's a lot quicker, and the network card / OS have to do very little work to translate the data back from the packets.

10. what is kernel panic error ? how will you fix it if you have face it after rebooting without the the help of rescue disk ?

 Many of the Mac OSX or similar Unix like operating system users may face a type of error known as “Kernel Panic”. When this error message get displayed, you need to restart your system as your system stops working and require restart.Since the system is not in the state that you can perform the normal restart and therefore you need to force restart the computer. At that time if you were in the middle of theprocess or working with some kind of unsaved document thenit will also be lose.

The general causes of kernel panic in Mac OS X include:
a) Defective or incompatible RAM
b) Incompatible, obsolete or corrupted kernel extensions
c) Incompatible, obsolete or corrupted Drivers
d) Hard Disk corruption that include bad sectors,
e) directory corruption and other hard disk errors
f) Incorrect permissions on System files and folders
g) Less RAM or Hard Drive Memory
h) Defects in hardware, CPU or programming errors
i) Incompatible hardware

Other than these the Mac Kernel Panic occurs when the core component of Mac (kernel) gets an unexpected user instruction and fails to handle that instruction properly.

Kernel Panic Fix in Mac OS X

It is monitored that the kernel panic does not come frequently but if it’s occurred then restarting the computer will solve the problem but if the error occurs due to the corrupted/incompatible system resources then reinstall Mac OSX. When you go for the fresh installation of Mac OSX, the primary volume need to be formatted and all the data present over that volume will be lost. This condition can be a bad dream as you can lose lots of important data which you had saved on that system volume.

11. Expalin the process of kickstart installation?

a) Reboot the system
b) Press f12
c) Select second option cd-rom drive
d) Then enter the kickstart path: linux ks=nfs:

12. There are 4 network Interfaces, how can we find which one is Primary.?
 When you type the command netstat -nr in your shell, you  will find a line starting with Something like UG 0 0 0 eth0

This line indicates if the system tries to contact a network outside its local network. It will first contact  the router and it does it with the primary interface. Hence in this case its eth0. So you can check this line for the primary interface

13. Without Using $date -d yesterday. How I get the yesterday's date ?

 $date --date='yesterday'
$date --date='1 day ago'

14. why kerberos.............what its need?

Kerberos is a authentication protocol it is used to send data from one system to anohter in encrypted form.

Most conventional network systems use password-based authentication schemes. When a user needs to authenticate to a service running on a network server, they type in their password for each service that requires authentication. Their password is sent over the network, and the server verifies their identity using the password.

Transmission of passwords in plaintext using this method, while commonly done, is a tremendous security risk. Any system cracker with access to the network and a packet analyzer (also known as a packet sniffer) can intercept any passwords sent this way.

The primary design goal of Kerberos is to ensure that passwords are never sent across a network unencrypted and are preferably never sent over the network at all. The proper use of Kerberos will eradicate the threat of packet sniffers intercepting passwords on your network.

15. what is the use of nis server in linux? what is the purpose

The main purpose of NIS is centralizing the authentication database.

For ex:

Usually when a user try to login to the machine it will contact the passwd, shadow and group files for user’s  authentication, in case of user requires to access his/her account across the network we need to update users  information all these files in each machine in the network. It is bit tricky to organize multiple users’ info in all the machines in the network.

NIS server will act as central server for user authentication and all other machines will contact the NIS server for the user’s authentication info.
Make sure all the machines in your network should be in the same domain. NIS will work only in single domain.

16. How many minimum partitions need to install the linux?

Two minimum partition need to install the linux

1: /boot
2: /

SWAP is not mendatary to create at the time of installation it is only use for Virtual Memory purpose.... as you required when u create...

17. how is FAT32 file system mounted in linux file system?

1: mkdir /kaka
2: open vim /etc/fstab and mount it permently.
3: mount -t vfat /dev/hda1 /kaka
4: /dev/hda1...... drive name.

18. Major difference between SMB and NFS ?

 main difference between samba and nfs is - By configuring samba we can access fileS from linux to window and window to linux but by nfs can't

19. Major difference between RPM and YUM ?

the main difference of rpm and yum is that yum will install all the package including dependencies if it is present in the server. but in rpm we have to install each and every dependency ourself.

20. Command to check last runlevelwho -r

21. Is it possible to give access to a nfs share to a particular user in a particular system?

you can give permission to an ip or to the users(The usershould be from the system where the file is gettingshared,external access from users arenot allowedexcept fornfsnobody). If you want to give permission to an ip then open /etc/exports...Let /data be the shared directory: /data,sync)

To give permission to a user like harry: setfacl -m u:harry:rwx /data.

By default the nfs gets accessed by the user nfsnobody. So you can add or remove a particular permissions to this user using acl.

22. In Linux OS, what is the file server?

NFS (Network File System) is the File server in Linux. We can also use the LDAP (Lightweight Direct Access Protocol)for the File server. NFS is easy to configure than LDAP. For NFS, we need the dameon portmap,nfsd etc../etc/exports is a file contains the partitions, which we want to share. NIS server which should configure for clients. we need ypbind,netfs services in clients

23.  Explain cups in linux.

 It is printer deamon

C - common
U - Unix
P - printing
S - system

24. what are pipes ? explain use of pipes ?

 a pipe is a chain of processes so that output of one process(stdoutput) is fed an input(stdinput) to another process.

25. What is the minimum number of partitions you need to install Linux?

Minimum 2 partitions are needed for installing Linux. 

The one is / or root which contains all the files and the other is swap. Linux file system is function specific which means that files and folders are organized according to their functionality. For example, all executables are in one folder, all devices in another, all libraries in another and so on. / or ‘root’ is the base of this file system. All the other folders are under this one. / can be consider as C: .Swap is a partition that will be used as virtual memory. If there is no more available RAM a Linux computer will use an area of the hard disk, called swap, to temporarily store data. In other words it is a way of expanding your computers RAM.

26. Which command is used to review boot messages?

dmesg command is used to review boot messages. This command will display system messages contained in the kernel ring buffer. We can use this command immediately after booting to see boot messages. A ring buffer is a buffer of fixed size for which any new data added to it overwrites the oldest data in it. Its basic syntax is

dmesg [options]

Invoking dmesg without any of its options causes it to write all the kernel messages to standard output. This usually produces far too many lines to fit into the display screen all at once, and thus only the final messages are visible. However, the output can be redirected to the less command through the use of a pipe, thereby allowing the startup messages to be viewed on one screen at a time
dmesg | less

27. What are the partitions created on the mail server hard drive?

The main partitions are done firstly which are root, swap and boot partition. But for the mail server three different partitions are also done which are as follows:
1. /var/spool- This is done so that if something goes wrong with the mail server or spool than the output cannot overrun the file system.
2. /tmp- putting this on its own partition prevents any user item or software from overrunning the system files.
3. /home- putting this on its own is useful for system upgrades or reinstalls. It allow not to wipe off the /home hierarchy along with other areas.

28. Which daemon is responsible for tracking events on Linux system?

syslogd is responsible for tracking system information and save it to the desired log files. It provides two system utilities which provide system logging and kernel message trapping.

29. Which daemon is used for scheduling of the commands?

The crontab command is used for scheduling of the commands to run at a later time. SYNTAX
crontab [ -u user ] file
crontab [ -u user ] { -l | -r | -e }

-l List - display the current crontab entries.
-r Remove the current crontab.
-e Edit the current crontab using the editor specified by the VISUAL or EDITOR environment variables.

30. how to recollect root password?

a) go to single user mode
b) type passwd and then the required password u want to change
c) if it gives u error on entering the passwd command
d) than type setenforce 0 it will disable the selinux for that moment and than again type the passwd command to change the password

31. what is LILO?

LILO stands for Linux boot loader. It will load the MBR, master boot record, into the memory, which tell the system which partition and hard drive to boot.

32. What is the difference between Telnet and SSH?

ssh is a secured shell, where telnet is not a secured one.when you ssh to trasnfer data between a system, the data will be send in the encrypted form, where the hacker cannot encode or decode it.

While you telnet,the data send between the system is alphabetical format(ASCII), where every one can understand. More over as per network security, telnet and ftp are prohibited. Always, trust SSL based data transfer.

33. User unable to login in server then how can u troubleshooting it? Example: server at Atlantic-DC. in that server two users try to login in server. 1st user able to login. but second user unable to login so how can troubleshoot it ?
Passwd expired r not

# usermod -l username

2)User is locked r not using the command

# passwd -u username -to unlock the user

3)passwd file problem

if any change in /etc/passwd file r /etc/shadow file

4)change the passwd


5)The default permission for security file is 600 when the value is changed,we can't login

#ls -ld /etc/secur

34. Explain linux file types?

7 types of files

- regular
d directory
l symbolic link
c character special file (hardware files)
b block special file (files to communicate with hardware)
p named pipe (to pass data between process )
s socket ( mechanism for inter-process communication

35. Please explain the file structure of linux?
The Linux system contains thousand of files located within many directories. All directories are organized in a tree-structure like manner.
* The 'trunk' of the tree is the root directory.
* The root directory is simply identified as a "/".
* All other directories 'branch' off from the trunk.

The following lists the most common directories and their intended contents.

* / - root directory
* /home - where directories are contained for each user,
* /usr - pronounced 'user' and contains Linux commands and utilities
o /bin - binary executable programs
o /lib - program libraries, similar to Windows 'dll' files
o /sbin - more executable programs and Linux utilities for administrative purposes
o /doc - documentation
o /src - source code to programs
* /tmp - temporary work files
* /etc - configuration files
o /rc.d - scripts used during boot and shutdown process
o /sysconfig - default configuration files
o /sysconfig/network-scripts - network scripts
o /sysconfig/daemons - special programs that run in background, such as print spooling
* /bin - binary executable programs that all users need
* /dev - device files that control drives, terminals andany equipment attached to the server
* /var - user specific files
o /log - log files containing system usage and errors
o /spool - where spooled files are stored during print spooling process
o /mail - where Email files are stored until retrieved by client Email program
* /proc - system files
* /root - root's home directory
* /opt - other options
* /sbin - more executable programs and utilities

36. Can we open pdf files in suse?

We can open .pdf file with the help of CUPS-PDF package.
Install CUPS-PDF package and use pdf file.

37. Why you shouldn’t use the root login?

Root has full control over the system Its like Admin.There ll be full credentials for root.If deleted any datas as root login its difficult to recover.

38. Who owns data dictionary?

The SYS user owns the data dictionary. The SYS and SYSTEM users are created when the database is created.

No comments:

Post a Comment