FREQUENTLY ASKED INTERVIEW QUESTIONS

In Linux, the setenforce command is used to change the SELinux mode. It means the user can use this command to change SELinux from Enforcing mode to Permissive mode. In Permissive mode, SELinux does not enforce security rules, but it records policy violations.
Command:
sudo setenforce 0
Example:
If you want to change the SELinux mode to Permissive in Linux, you can use the following command.
sudo setenforce 0
Output:
[user@localhost ~]$
Here:
setenforce 0changes SELinux to Permissive mode.- Permissive mode allows actions but records policy violations.
How to use:
- Open the Linux terminal.
- Type the command.
- Press Enter to run the command.

The file is /etc/selinux/config, which is used to configure SELinux in Linux. It helps you set the SELinux mode.
File:
/etc/selinux/config
Example:
If you want to check the SELinux settings in Linux, you can use the following command.
cat /etc/selinux/config
Output:
SELINUX=enforcing
SELINUXTYPE=targeted
Here:
You can use the /etc/selinux/config file to set the SELinux mode in Linux.
enforcingfollows SELinux security rules.permissiverecords rule breaks but does not stop actions.disabledturns off SELinux.

In Linux, the hostname command is used to show or change the computer's name.
Command:
hostname
Example:
If you want to see your computer's name in Linux, you can use the following command.
hostname
Output:
localhost.localdomain
Here:
- The output shows the computer's name.
How to use:
- Open the Linux terminal.
- Type the command.
- Press Enter to see the computer's name.
To change the computer's name:
sudo hostname newname

In Linux, the systemctl command is used to manage system services. It helps you start, stop, and check services.
Command:
systemctl
Example:
If you want to check a service in Linux, you can use the following command.
systemctl status sshd
Output:
sshd.service - OpenSSH server daemon
Loaded: loaded
Active: active (running)
Here:
sshd.serviceshows the service name.Loadedshows that the service is loaded.Activeshows that the service is running.
How to use:
- Open the Linux terminal.
- Type the command.
- Press Enter to check the service.

In Linux, the ifconfig command is used to show or change network settings.
Command:
ifconfig
Example:
If you want to see network information in Linux, you can use the following command.
ifconfig
Output:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>
inet 192.168.1.10
netmask 255.255.255.0
lo: flags=73<UP,LOOPBACK,RUNNING>
inet 127.0.0.1
Here:
eth0shows the network interface name.inetshows the IP address.netmaskshows the network mask.lois the loopback network interface.
How to use:
- Open the Linux terminal.
- Type the command.
- Press Enter to see network information.











