Saturday, March 16, 2024

Linux Interview Questions And Answers For Experienced

Don't Miss

Linux Administrator Interview Questions And Answers For Frehsers

Linux Interview Questions and Answers with Practical – Real Time

6) Which commands are normally recommended to edit /etc/passwd, /etc/shadow, /etc/group and /etc/gshadow files?

ANS: vipw > edit the user password file vigr > edit the user group filevipw -s > to edit shadow password file vigr -s > to edit shadow group file

These commands would normally lock the file while editing to avoid corruption.

7) Whenever an user tries to login via terminal, system would throw up the error The account is currently not available, otherwise, via GUI when user enters password, it looks to be logging in, however, comes back to the login prompt. How could this issue be fixed?

ANS: This is because of the shell field set as /sbin/nologin in /etc/passwd file, so change this back to /bin/bash and user should be allowed to login.

If the shell field is set as /bin/false then whenever an user tries to login there would not be any error or messages, it just comes back to the login prompt and same happens in GUI mode.

How do you make a new user to reset his password upon his first login?

You are required to change your password immediately Changing password for mango.

ANS: Use chage command and set the expiration date as given below

skel]# chage -d 0 mango

< < To view password aging details > >

Create users home directory in /home1 directory instead of default /home directory. This gets applicable to any new users who gets created i.e the home directory of that user should be /home1/< UserName> /

ANS: Edit /etc/default/useradd

umask 0077

How Do You Change Permissions Under Linux

Assuming you are the system administrator or the owner of a file or directory, you can grant permission using the chmod command. Use + symbol to add permission or symbol to deny permission, along with any of the following letters: u , g , o , a , r , w and x . For example, the command chmod go+rw FILE1.TXT grants read and write access to the file FILE1.TXT, which is assigned to groups and others.

Linux Networking Interview Questions And Answers

1) How do you change the network speed of an interface to 100Mbps with auto-negotiation off and duplex in full mode?

ANS : #ethtool -s eth0 speed 100 autoneg off duplex full To make this changes persistent need to add the below line to /etc/sysconfig/network-scripts/ifcfg-eth0 file:ETHTOOL_OPTS=speed 100 autoneg off duplex full

2) Every time the system reboots the network interface doesnt come up. However, if you restart network service or execute ifup eth0 command which would bring up the network fine? How could this be fixed?

ANS : Make sure that ONBOOT=Yes is set in the respective configuration file . In this case the ONBOOT parameter would be set to NO.

If the above step doesnt help then check /etc/sysconfig/network file and make sure NETWORKING is set to Yes.

3) How do you check the network routing table using commands?

ANS : #route -nOR#netstat -nr

4) After changing the network card on a system the network interface name got changed from eth0 to eth1. This shows when you run the command ifconfig -a. Running service network restart, shows this error Device eth0 doesnt seem to be present. But when you run the command ifconfig -a you would notice eth1 is listed there instead of eth0. So, running ifup eth1 shows error as configuration for eth1 not found. How to make sure that the network interface becomes eth0 here and up along with the server?

* This file has been deprecated in RHEL7.x

OR

Stop the network service. .

You May Like: Terraform Interview Questions And Answers

What Is The Minimum Number Of Disk Partitions Required To Install Linux

The minimum number of partitions required is 2.

One partition is used as the local file system where all the files are stored. This includes files of the OS, files of applications and services, and files of the user. And the other partition is used as Swap Space which acts as an extended memory for RAM.

Linux System Hardware Interview Questions And Answers

Javarevisited: Top 30 UNIX command Interview Questions asked in ...

1) Commands:

To check memory availability #free -m Or #cat /proc/meminfo OR top or #vmstat To check CPU details #cat /proc/cpuinfo Or lscpu or check in dmesg To check the loaded modules #lsmod To load a module #modprobe To check all network interfaces #ifconfig -a Or ip a Or #cat /proc/net/dev To scan bus so that all newly added devices/luns would come up: #rescan-scsi-bus.sh or #echo – -> /sys/class/scsi_host/host< ID> /scan To check most recent system reboot :#last reboot | head -1

Desktop]# last reboot|head -1reboot system boot 2.6.32-431.el6.x Thu Jul 17 15:43 17:09

To check the most recent system shutdown time :#last -x|grep shutdown|head -1

Desktop]# last -x | grep shutdown|head -1shutdown system down 2.6.32-431.el6.x Thu Jul 17 15:43 15:43

To check processor statistics : #mpstat or #iostat

2) Common Standard Ports Used :

ANS: =

3) How to find out the system hardware details such as manufacture, product name etc,.?

ANS: Using dmidecode

#dmidecode type system |egrep -i Manufacturer|Product Name|Serial Number|FamilyOR#dmidecode type system |grep System Information -A 8

To find out BIOS details :#dmidecode type bios |grep BIOS Information -A 6

Please visit my recent blog post for more details and easier way to get the information:

View System Hardware Info

4) The option Open in Terminal is missing when user right clicks on terminal in GUI. How to fix this?

DISPLAYMANAGER=KDEDESKTOP=KDE

Don’t Miss: How Do I Prepare For A Job Interview

How Do You Manage System Logs In Linux

To manage system logs in Linux, you can use the syslog service. This service allows you to collect, rotate, and manage log files on your system. The syslog service writes logs to files in the /var/log directory, and you can use the journalctl command to view the logs. You can also use the rsyslog configuration file to specify how logs should be handled, such as which logs should be written to which files.

Whether you are a beginner or an experienced professional, understanding Linux is essential for success in the world of technology. By familiarizing yourself with common Linux interview questions and answers, you can build your knowledge and skills, and demonstrate your expertise to potential employers. With a strong understanding of Linux, you can unlock many opportunities in the field and take your career to the next level. The Linux Interview Questions and Answers covered in this post should help you prepare for such an interview and improve your understanding of Hibernate. We hope these Linux Interview Questions help you in cracking your next job Interview easily.

All The Best!

File System Security And Management

Learning Objectives – In this module of linux admin certification, you will understand the file system management which includes mounting, unmounting and automounter techniques. We will discuss details of file system security and also understand how permissions are applied.

Topics – Device Recognition, Disk Partitioning, Managing Partitions, Making Filesystems, Mount and unmount CIFS and NFS network file systems, Filesystems and types, Labels, tune2fs, Mount Points and /etc/fstab, Mounting Filesystems with mount, Unmounting Filesystems, Handling Swap Files and Partitions, NFS server and NFS Client, NFS share for group collaboration, Mounting NFS Filesystems, Use Kerberos to control access to NFS network shares, Automounter, Annies Quizzes, LAB, Q & A, Quick Recap.

Read Also: How To Prepare For Google Engineering Manager Interview

What Are The Basic Elements Or Components Of Linux

Linux is made up of five basic elements or components as mentioned below:

  • Kernel: The kernel is the heart or the main part of Linux. It is responsible for all the main activities of OS such as process management, device management, etc.
  • System Library: These are special programs/functions which allow application programs/system utilities to access features of the kernel without any code.
  • System Utility: These are utility programs responsible to perform specialized and individual-level tasks. They allow users to manage the computer.
  • Hardware: It is the physical hardware. It includes items such as a mouse, keyboard, CPU, display, etc.
  • Shell: It is an environment where we can run our commands, shell scripts and programs. It is the interface between the user and kernel. It is used to execute commands.

What Is A Microprocessor

linux top interview questions and answers for experienced with Example

A Microprocessor is a device that executes instructions. It is a single-chip device that fetches the instruction from the memory, decodes it and executes it. A Microprocessor can carry out 3 basic functions:

  • Mathematical operations like addition, subtraction, multiplication, and division
  • Move data from one memory location to another
  • Make decisions based on conditions and jump to new different instructions based on the decision.
  • You May Like: How Can I Introduce Myself During Interview

    Describe Your Process For Creating An Ext4 File System

    This may also seem like a basic LINUX interview question, and the interviewer might ask you something related to file creations in the LINUX system to get a better understanding of how you make processes like this efficient. You might offer a quick and clear command in your answer so the interviewer can see you have experience with the basics of LINUX commands.

    Example:”All that’s really needed to create a separate ext4 file system is a single command. I would enter the command ‘# mke2fs -t ext4 /dev/DEV’ into the entry lines and a new file system should open.”

    How Do You Schedule Tasks In Linux

    To schedule tasks in Linux, you can use the cron service. This service allows you to run commands or scripts at specified intervals. To schedule a task, you need to edit the crontab file and add a new entry with the schedule and command to be executed. For example, to run a script called myscript.sh every day at midnight, you would add the following entry to the crontab file: 0 0 * * * /path/to/myscript.sh.

    Read Also: What Questions To Ask In A Financial Advisor Interview

    Linux Admin Interview Questions And Answers For Freshers

    Q1. What is a Root Account, and what is its purpose?

    A system administrator account that exists by default when installing LINUX is referred to as a root account. A root account helps us:

    • Apply complete control over the system.
    • Create and maintain several user accounts
    • Assign appropriate permissions to each user account.

    Q2. In Linux, what do we need to set up Password Aging?

    To set up password aging in Linux, we need:

    • The chage command, which allows the system administrators in Linux to enforce password aging. Chage is used to change the time duration between compulsory password changes.
    • The file /etc/login.defs, which is responsible for handling system-wide configuration. It can be edited for:

    PASS_MAX_DAYS, which represents the maximum number of days for which a password may be valid.

    PASS_MIN_DAYS, which represents the minimum number of days that need to pass before you can change your password again.

    PASS_WARN_AGE, which represents the number of days after which a warning is given before the current password expires.

    Q3. Define symbolic links.

    Symbolic links redirect to another file somewhere in the file system, but the target file does not store any data. So if the target file is deleted, the link to that file is removed, but not the file.

    Q4. What are Daemons?

    Background processes that accept requests for service from other computers are called Daemons.

    Q5. What is BASH?

    What Are The Contents Of /usr/local

    Linux Interview Questions and Answers for experienced

    It contains locally installed files. This directory matters in environments where files are stored on the network. Specifically, locally-installed files go to /usr/local/bin, /usr/local/lib, etc.). Another application of this directory is that it is used for software packages installed from source, or software not officially shipped with the distribution.

    Recommended Reading: Good Clinical Practice Interview Questions

    How To Run Multiple Commands In Single Command

    To run multiple commands one after the other in a single command, you can use either the semi-colon ‘ ‘, double ampersand ‘& & ‘, or ‘||’ symbols.

    • X Y This runs commands X and Y regardless of the success of X.
    • X & & Y This runs Y if and only if X runs successfully.
    • X || Y This runs Y if and only if X failed.

    How Is Linux Different From Other Operating Systems

    Linux is different from other operating systems in several key ways:

    • It is a free and open-source operating system, which means that users have complete control over the software and can modify it to suit their needs.
    • It is based on the Linux kernel, which is a highly stable and secure foundation for the operating system.
    • It is highly flexible and can be customized to meet the needs of a wide range of users and applications.
    • It has a large and active community of users and developers who contribute to the development of the operating system and provide support to users.

    You May Like: Amazon Business Intelligence Engineer Interview

    What’s Your Greatest Strength

    This question may gauge your self-awareness and communication skills. It also shows whether you researched the position. List your most competitive expertise and elaborate on how it relates to the job. Before the interview, reviewing the job posting and reading its description and specification is beneficial. The job description may outline the opening’s responsibilities and expectations, while the specification highlights potential candidates’ mandatory requirements.

    Example:’My greatest strength as a Linux expert is effective communication. While a significant portion of the job involves working with computers and bots, it’s equally important to work with colleagues, clients and supervisors, which requires strong communication skills. I use these skills to understand customers’ needs, collect client feedback and translate complex Linux terms and concepts into formats everybody can understand. I believe that the better stakeholders understand a project, the more likely they are to support it’.

    Related:What Are Strength-Based Interviews?

    What Are The Advantages Of Using Linux

    Linux Interview Questions and Answers 2022 | Linux Interview Questions for Beginners | Simplilearn

    There are many advantages to using Linux, including:

    • It is a free and open-source operating system, so users have complete control over the software and can modify it to suit their needs.
    • It is highly stable and secure, making it a great choice for mission-critical systems.
    • It is highly flexible and can be customized to meet the needs of a wide range of users and applications.
    • It has a large and active community of users and developers who contribute to the development of the operating system and provide support to users.
    • It is compatible with a wide range of hardware, including laptops, desktops, servers, and embedded systems.

    You May Like: Ehs Manager Interview Questions And Answers

    What Are Virtual Terminals

    Virtual Terminals are similar to Terminal that you have been using so far. They are used for executing commands and offering input. The only difference is that you cannot use the mouse with the Virtual Terminals. Therefore, you need to know the keyboard shortcuts.

    Virtual Terminals enable a number of users to work on different programs at the same time on the same computer. This is the reason they are one of the most distinguished features of Linux.

    Top 60 Linux Interview Questions And Answers

    Are you preparing for Linux interview? If yes, we are presenting 60 must-read Linux interview questions with detailed answers based on various scenarios.

    These Linux interview questions will undoubtedly add enough knowledge so that you can crack your Linux interview and you will be able to answer them with confidence. We have a series of interview questions and answers for your Linux interview preparation based on various levels of basic, advanced, technical, admin, kernel, and commands.

    So, to start with, first of all, we are going to answer some of the basic Linux interview questions, and we will move to more and more level up so that you can prepare well for the Linux interview and your performance will be highly appreciated. These Linux interview questions will be helpful for you in last-minute interview preparation. However, we advise you to validate your skills with a Linux certification, so it will increase your chances of getting the job.

    You May Like: How To Crack Google Data Analyst Interview

    Linux User Management Interview Questions

    1) Which files stores the user min UID, max UID, password expiration settings, password encryption method being used etc.,?

    ANS : /etc/login.defs

    2) How do you make a file copied to a new user account automatically upon user account creation?

    ANS : Store the file in /etc/skel directory.

    3) List the fields in /etc/passwd file.

    ANS : UserName | Password | UserID | GroupID | Comments | HomeDir | LoginShell

    < Couple of lines from /etc/passwd file are pasted below for reference>

    redhat:x:500:500:Redhat User:/home/redhat:/bin/bash

    x in the password column indicates that the encrypted password is stored in /etc/shadow file.

    4) How to lock an user account?

    ANS: This can be done by using either usermod -L < UserName> or passwd -l < UserName> commands.

    Example:-

    #usermod -L mango

    Once an account gets locked, there would be an exclamation mark before the encrypted password files in /etc/shadow as shown below:

    mango:!$1$O5zV5Rj/$XhuRe8Og.AiXMXDGSIsae/:16266:0:99999:7:::

    5) How to disable user login via terminals?

    ANS: Add /sbin/nologin field instead of /bin/bash in /etc/passwd file.

    Can You Define Linux And Discuss Its Essential Components

    Hibernate Interview Questions and Answers

    Employers ask this question to gauge your knowledge of the Linux OS. This is your opportunity to show your mastery of Linux distributions and the Linux kernel. While this question asks you to address two things simultaneously, keep your answer short and direct. Brevity shows the hiring manager that you understand the concept well.

    Example:’Linux is a Unix-like OS or kernel. You can use it to refer to any OS using the Linux kernel at its core. A typical Linux kernel comprises configurable software tools and packages, a Linux kernel, utilities, a user interface and shells’.

    Also Check: Mobile App Development Interview Questions

    What Are The Various Network Bonding Modes Used In Linux

    The following are the various network bonding modes used in Linux:

    • Mode-0 : It is the default mode and works on round-robin policy. It has fault tolerance and load balancing.
    • Mode-1 : It works on active-backup policy. Only one node works at the time of failure of other nodes.
    • Mode-2 : It sets an XOR mode for providing load balancing and fault tolerance.
    • Mode-3 : It works on broadcast policy. It provides a broadcast mode that is fault-tolerant and can be used for specific purposes only.
    • Mode-4 : It is based on IEEE 802.3ad standard which is also called Dynamic Link Aggregation mode. It creates aggregation groups that have the same speed and duplex settings.
    • Mode-5 : It is also known as Adaptive TLB . It offers the TLB mode for fault tolerance and load balancing. Traffic will be loaded based on each slave of the network.
    • Mode-6 : It is also called Adaptive Load Balancing. It offers ALB mode for fault tolerance and load balancing. It does not need any special switch support.

    More articles

    Popular Articles