Every tech suport should know this –Linux

What is the full path that contains YUM repositories on Cpanel & WHM systems?

Ans: yum.repos.d/

True or False: Running '/usr/local/apache/bin/apachectl -l' from command line  as root will list modules compiled in Apache

1. True
2. False

Ans: True

In what directory are custom DNS Zone Templates stored?

1. /var/cpanel/templates
2. /root/zonetemplates
3. /usr/local/cpanel/src/templates
4. /var/cpanel/zonetemplates

Ans: /var/cpanel/zonetemplates

In what log file would you find account creation/termination information?

1. accounting.log
2. access.log
3. cpsrvd.log
4. error.log

Ans: accounting.log

If your CentOS sever was not able to resolve a domain (cpanel.net for example). what file  would you check and/or add nameservers to help resolve domains?

1. /etc/sysconfig/network
2. /usr/local/cpanel/resolv.conf
3. /etc/hosts
4. /etc/resolv.conf

Ans: /etc/resolv.conf

What does the 'usermod -s' command do?

1. Changes shell line in /etc/passwd
2. Sets the user's access to shell
3. Set's the user's module access
4. Removes a user from the system

Ans: Sets the user's access to shell

Changing Shell

There may be some circumstances where you may need to change the login shell of a user, and I can think of a few already. Whenever you are setting up an account to use another service and not actually log into the shell (for example an FTP account) it is always a good idea to run this:

usermod -s /bin/false ftp

This will ensure ftp gets rejected any time they tries to access the shell though SSH or telnet or other similar protocols, but will still allow them to manage non-shell stuff such as the FTP protocol and the HTTP protocol.

Which of the following files is Pure-FTP's error log?

1. /etc/pureftpd/log
2. /var/log/userlog
3. /var/log/messages
4. /var/log/ftp/error_log

Ans: /var/log/messages

What is the directory /home/virtfs used for?

1. Jailshell
2. Account Creation
3. FTP
4. MySQL

Ans: Jailshell

What script would you use to manually add an email account from command line?

Ans: /scripts/addpop

What service does /usr/local/cpanel/bin/splitlogs change loggin for?

1. Exim
2. FTP
3. Apache
4. Cpanel

Ans: Apache

What does the strace utility do?

1. Outputs system environmental details
2. Displays memory allocation
3. Verbosely prints Debugging information
4. Traces system calls

Ans: Traces system calls

On which port does Tomcat listeb by default?

1. 2890
2. 3306
3. 80
4. 8080

Ans: 8080

Which of the following directories contains the Cpanel & WHM installation log?

1. /var/cpanel/logs
2. /usr/local/cpanel
3. /usr/local/cpanel/logs
4. /var/log

Ans: /var/log

For which of the following mod_mono used?

1. Apache ASP.NET Support
2. Apache Proxy Support
3. Apache MSSQL Support
4. Apache Bandwidth Tracking Module

Ans: Apache ASP.NET Support

Which file contains the Mysql root user's password on Cpanel & WHM systems?

1. /var/cpanel/.my.cnf
2. /usr/local/cpanel/3dparty
3. /root/.my.cnf
4. /etc/my.cnf

Ans: /root/.my.cnf

What is the file that handles PostgreSql's configurations settings on a Cpanel & WHM systems?

1. /var/lib/pgsql/postgresql.conf
2. /var/lib/pgsql/data/pg_hba.conf
3. /var/lib/pgsql/perl5/pg_ident.conf
4. /var/lib/pgsql/data/postgresql.conf

Ans: /var/lib/pgsql/data/postgresql.conf

Which of the following commands will remove or uninstall an RPM?

1. rpm -e
2. yum delete package
3. rpm –remove
4. rpm erase

Ans: rpm -e

Which of the following  commands (on RedHat or Centos system) will display inforamation aboout how memory is being used by the server

1. /usr/bin/memhog -sA
2. free
3. /usr/sbin/meminfo -a
4. cat /proc/meminfo

Ans: free and cat /proc/meminfo

True of False: Cpanel & WHM requires SELinux to works?

1. True
2. False

Ans: False

What files permissions would /usr/bin/gcc have upon disabling WHM's Compiler Access?

1. 600
2. 750
3. 644
4. 755

Ans: 750

What file is used to prevent updates to certain files by Cpanel?

1. /var/cpanel/exclude
2. /etc/upcp.exclude
3. /etc/cpanelsync.exclude
4. /etc/cpupdate.conf

Ans: /etc/cpanelsync.exclude

Which is the script used to update Apache & PHP?

1. /scripts/apacheup
2. /scripts/easyapache
3. /scripts/sysup
4. /scripts/upcp

Ans: /scripts/easyapache

Select all of the webmail clients that are included with Cpanel

1. Microsoft Exchange
2. Horde
3. SquirrelMail
4. Roundcube
5. Eudora
6. Gmail
7. NeoMail
8. Thunderbird

Ans: Horde, SquirrelMail, Roundcube

What is the full path to the script you should run after editing a user file in /var/cpanel/users?

1. /usr/local/cpanel/scripts/mailperm
2. /usr/local/cpanel/scripts/fixeverything
3. /usr/local/cpanel/scripts/resetquotas
4. /usr/local/cpanel/scripts/updateuserdomains

Ans: /usr/local/cpanel/scripts/updateuserdomains

Which of the following files  is MySql's Startup error log?

1. /var/lib/mysql
2. /usr/local/cpanel/logs/mysql-err.log
3. /var/lib/mysql/hostname.err
4. /var/log/mysql-err.log

Ans: /var/lib/mysql/hostname.err

Which of the following commands will rebuild the RPM database?

1. rpm –justdb
2. rpm –rebuilddb
3. yum clean all
4. rpm –initdb

 Ans: rpm –rebuilddb

On which default port does Mysql listen for a connection?

1. 25
2. 3306
3. 27015
4. 80

Ans: 3306

If Cpanel & WHM was showing a blank page or an error, what is the full path to the log file yo should check first?

Ans: /usr/local/apache/logs/error_log

If the system log shows repeated connections to TCP port 143, which service is being accessed?

1. SNMP
2. SMTP
3. POP3
4. IMAP

Ans: IMAP By default imap runs on port 143

How would you force Cpanel & WHM to update when using the command line interface?

Ans: /scripts/upcp –force

What is the script you can use to install PostgreSQL on a Cpanel & WHM server?

Ans: /scripts/installpostgres

What is the name of the script you should use whenever you encounter a "License File Expired" message?

Ans: /usr/local/cpanel/cpkeyclt

What is the name of the script that you should  use to update Cpanel & WHM licenses?

Ans: /scripts/upcp

What is YUM?

1. Cpanel & WHM's update utility
2. A package manager for BSD
3. Your Update Manager
4. A package manager for Linux

Ans: A package manager for Linux (Yellow dog Updater)

Which of the following directories contains EasyApache's log files?

1. /usr/local/apache/logs
2. /var/log
3. /usr/local/cpanel/logs/easy/apache
4. /var/log/easy/apache

Ans: /usr/local/cpanel/logs/easy/apache

If you wanted to change the shared main IP on your Cpanel & WHM machine, what area of WHM would you use to change the IP for all sites and sections?

1. Basic Cpanel & WHM Setup
2. Change Multiple Sites IP Addresses
3. IP Migration Wizard
4. Change Hostname

Ans: Basic Cpanel & WHM Setup

What  port is used to securely log into webmail? Please include the port number in your answer

Ans: 2096

What does the 'ipcs -s' command do?

1. Shows connection settings information
2. Shows semaphores
3. System Process counter
4. Shows system memory usage

Ans: Shows semaphores

Which file does Tweak Settings save its settings?

1. /usr/local/cpanel.conf
2. /var/cpanel/cpanel.config
3. /etc/wwwacct.conf
4. /etc/settings.conf

Ans: /var/cpanel/cpanel.config

Which of the following directories contains the Tomcat installation  on Cpanel & WHM?

1. /etc/tomcat
2. /usr/local/tomcat
3. /usr/local/cpanel/3rparty/tomcat
4. /usr/local/jakarta

Ans: /usr/local/jakarta –

 Select the most popular, officially recommended update tier to use

1. EDGE
2. STABLE
3. CURRENT
4. RELEASE

Ans: RELEASE

Which command is used to change settings on IDE hard disk drives?
1. hdparm
2. hddparm
3. diskparm
4. hdparam
5. ideconfig

Ans : hdparm

hdparm is a command line utility for the Linux operating system to set and view IDE hard disk hardware parameters. It can set parameters such as drive caches, sleep mode, power management, acoustic management, and DMA settings.

Before using hdparm it is important to read its man page

 

What type of packet does an IP ping use (provide acronym)?

Ans : Internet Control Message Protocol i.e ICMP

4) To learn more about the management of an Internet site, the best utility to use would be:
1. whois
2. traceroute
3. ping
4. telnet
5. rpcdump

Ans : whois and telnet

If you had a Linux system routing 3 different Networks through 3 NICs and you were having trouble with your IP-Forwarding. where would you look to ensure that IP-Forwarding is actually enabled?
1. cat /proc/sys/net/ipv4/ip_forward
2. netstat
3. cat /proc/net/tcp
4. iptraf -d eth0
5. tail -f /var/log/messages

Ans : cat /proc/sys/net/ipv4/ip_forward

What file is used for associating port numbers to port names?
1. /etc/services
2. /etc/hosts
3. /etc/inetd.conf
4. /etc/securetty
5. /etc/ports

Ans : /etc/services

The /etc/services file enables server and client programs to convert service names to these numbers -ports. The list is kept on each host and it is stored in the file /etc/services. Only the “root” user is allowed to make modification in this file and it is rare to edit the /etc/services file to make change since it already contains the more common service names to port numbers. To improve security, we can immunize this file to prevent unauthorized deletion or addition of services

Which file can you create to prevent non-root users from logging into the system? (specify path and filename)

Ans : /etc/nologin

What command can be used to display a formatted output of the wtmp file? (no arguments)

Ans: # last

Last searches back through the file /var/log/wtmp (or the file designated by the -f flag) and displays a list of all users logged in (and out) since that file was created. Names of users and tty’s can be given, in which case last will show only those entries matching the arguments. Names of ttys can be abbreviated, thus last 0 is the same as last tty0.

When last catches a SIGINT signal (generated by the interrupt key, usually control-C) or a SIGQUIT signal (generated by the quit key, usually control-\), last will show how far it has searched through the file; in the case of the SIGINT signal last will then terminate.

The pseudo user reboot logs each time the system is rebooted. Thus last reboot will show a log of all reboots since the log file was created

Which command can be executed by a user who is already logged into the system, in order to change to the root user? (type the command without any parameters)

Ans : “su”

Type the full command you could use to decompress the file “foo.gz”

1. gzip -d foo.gz
2. gunzip -d foo.gz
3. gunzip foo.gz
4. unzip foo.gz
5. decompress foo.gz

Ans : gunzip foo.gz

You need to find out which package owns a file called /etc/paper.config. Which command will answer this question?

1. rpm -qf /etc/paper.config
2. rpm -qa|grep /etc/paper.config
3. rpm -Fq /etc/paper.config
4. rpm -q /etc/paper.config
5. rpm –requires /etc/paper.config

 rpm -qf /etc/paper.config

You can find out which rpm a file belongs to by using the rpm -q -f command. You must have the redhatrpmdb rpm installed though.

Where are source RPMs installed?
A. /usr/src/linux/rpms/
B. /var/src/linux/rpm/
C. /var/rpm/src/
D. /var/linux/rpm/src/

Ans : None of above.

Source RPMs are installed in /usr/src/redhat. There are 5 subdirectories under there. SOURCES contains the original source code. SPECS contains the specification files that control the RPM build process. BUILD is where source code is uncompressed and built. SRPMS contains the source RPM that is created when you build one.

How can you turn off interface eth1?

A. service network stop
B. service netork stop eth1
C. ifstop eth1
D. ifdown eth1
E. ps -aux |grep eth1| kill `awk -f {$1}`

Ans : ifdown eth1

What directory contains the kernel?

A. /
B. /kernel
C. /etc
D. /boot
E. /var/log

Ans : /boot

How can you see the kernel routing table?

A. netstat -Route
B. netstat -rn
C. netstat -an
D. route show default gw
E. netstat

Ans : netstat -rn

How do you enable quotas on a partition in /etc/fstab?

A. Add the enforcequotas option
B. You don’t. Quotas are turned on automatically when you install the quota rpm.
C. Add the quota option.
D. Add the usrquota and grpquota options.
E. You put a 1 in the last column.

Ans : Add the usrquota and grpquota options

To enable quotas on a partition you put the userquota and groupquota option in the options section for the partition in /etc/fstab.

How can a user set up their own crontab entry?

A. vi ~/.crontab
B. cp /etc/crontab .
C. crontab -v
D. crontab -e
E. cron –edit

Ans : crontab -e

What command will turn off the ftpd service in all runlevels?

A. chkconfig ftpd off
B. rm /etc/rc.d/init.d/*ftpd*
C. chkconfig –levels 12345 ftpd off
D. service ftpd stop
E. service ftpd stop -persistant

Ans : chkconfig –levels 12345 ftpd off

Which parameters are use in rsync command to copy file/folder from source to destinations with same permission, ownership and groups ?

Ans : rsync –pog

Write the rysnc command transfer File and subdirectory under “folder” directory to the /backup directory on remote host domainhost.com ( port number is 39393)

Ans : The correct command is as follows:

#/usr/bin/rsync -vrplogDtH -e “ssh -p 39393″ folder [email protected]:/backup/

Which is the command to enable suid /etc/hosts file .

Ans : # chmod a+s /etc/hosts

Which following command will show only server hostname

1. uname -h
2. uname -a
3. uname -n
4. uname –r

Ans : # uname -n

What does the following cron entry do?

10 5 * * * /bin/foo

A. runs /bin/foo every 10 minutes 5 days a week
B. runs /bin/foo at 10:05 AM every day
C. runs /bin/foo on the 10th of May every year
D. runs /bin/foo at 5:10 AM every day

Ans : runs /bin/foo at 5:10 AM every day

The fields are: minute, hour, day of month, month, day of week

You have created a /home/projectx directory with the owner of projectx and a group of projectx. How can you set its permissions so that all files created in this directory are owned by the projectx group?

A. chown projectx.projextx /home/projectx
B. chgrp projectx /home/projectx
C. chmod 755 /home/projectx
D. chmod g-s /home/projectx
E. chmod g+s /home/projectx

Ans : chmod g+s /home/projectx

What command do you use to edit the default grace period for quotas?

A. quotaconfig -g
B. editquota -g
C. quotaconfig -t
D. edquota -t
E. quotaeditor –grace

Ans : edquota -t

What file contains the configuration for BIND?

A. /etc/bind.conf
B. /etc/named.conf
C. /etc/dns.conf
D. /var/named/bind.conf
E. /var/named.conf

Ans : /etc/named.conf

Which file contains the list of terminals that root is allowed to log into?

A. /etc/rooterm.conf
B. /etc/terminals
C. /etc/secure
D. /etc/tty.conf
E. /etc/securetty

Ans : /etc/securetty

How can you find out which ports are being used?

A. ifconfig -a
B. netstat -a
C. netstat -rn
D. ports
E. cat /etc/services

Ans : netstat –a

You want to add a directory to all users paths. What file should you edit to do this?

A. /etc/sysconfig/profile
B. /etc/sysconfig/profile
C. /etc/bashrc
D. /etc/profile
E. /etc/env

Ans : /etc/profile

The /etc/profile script is used for system-wide enviornment variables and startup files. You could also create a new file in /etc/profile.d/ that ends in .sh and set the enviornment variable in there. Keep in mind that not all users will necessarily use bash

 Sendmail is an example of a(n):?

A. MTA
B. MUA
C. MDA
D. MLA
E. All of the above

Ans : MTA

Which files are used to configure TCP Wrappers?

A. /etc/tcpwrapper.conf and /etc/hosts.conf
B. /etc/hosts.allow and /etc/hosts.deny
C. /etc/tcpwrapper.conf and /etc/xinetd.conf
D. /etc/access.conf and /etc/xinetd.conf
E. /etc/tcpwrapper and /etc/access.conf

Ans : /etc/hosts.allow and /etc/hosts.deny

Which options to chmod allow read access to all but only allow write and execute access to the owner?

A. chmod 777 filename
B. chmod 700 filename
C. chmod 744 filename
D. chmod 447 filename
E. chmod 775 filename

Ans : chmod 744 filename

Which file do I edit to prevent specific users from accessing an ftp server?

A. /etc/hosts.allow
B. /etc/hosts.deny
C. /etc/ftpacess
D. /etc/ftpusers
E. /etc/ftpd.conf

Ans : /etc/ftpusers

Which  file do you edit to set the default runlevel?

A. /etc/grub.conf
B. /etc/lilo.conf
C. either A or B
D. /etc/inittab
E. /etc/runlevel

Ans : /etc/inittab

How do I immeadiately restart a Linux system?
A. Turn off the monitor then turn off the CPU.
B. /sbin/stop
C. init 6
D. shutdown -r now
E. None of the above

Ans : shutdown -r now

How do you install an RPM?
A. rpm -evh packagename.rpm
B. rpm -ivh packagename.rpm
C. rpm -q packagename.rpm
D. rpm -qa *.rpm
E. rpm -ql *.rpm

Ans : rpm -ivh packagename.rpm

Which is default firewall in Linux
A. apf
B. csf
C. iptables
D. black

Ans : iptables

Define following command with usage()

Pwd : Print the full pathname of the current working directory.

Ps : report a snapshot of the current processes.
Netstat : The netstat command symbolically displays the contents of various net-work-related data structures
Grep : searches the input files, selecting lines matching one or more patterns; the types of patterns are controlled by the options specified.

Write down a command to check just MX record of domain http://yourdomain.com

Ans : dig mx yourdomain.com +short

How to check the version of linux installed on your server via command line.

Ans : cat /etc/redhat-release

Apache runs under privileges of which user?

1. apache
2. nobody
3. root
4. no user

Ans : nobody

Write down command you will use to bind muliple ip to your NIC card(eth0)

Ans Step 1 : #cd /etc/sysconfig /network-scripts

step 2 : #cp icfg-eth0 ifcfg-eth0:0

#cp ifcfg-eth0 ifcfg-eth0:1

#cp ifcfg-eth0 ifcfg-eth0:2

Step 3 : #vi ifcfg-eth0:0

step 4 : # ifup eth0:0

Repeat step 3 and 4 but make sure to update correct device and IPadd

How to set date & time on a system.(set it to 27th oct 2012 and 13:00hrs)

Ans : date –set=’Sun Oct 27 13:00:00 IST 2012′

How to block a IP address with iptables? (10.10.10.123)

Ans : iptables –A INPUT –s 10.10.10.123 –j REJECT

Set hostname of your server permanetly to yourdomainhost.com (Write down commands and files which you edit)

Ans : # hostname yourdomainhost.com

# edit /etc/hosts and add following line on first link

yourdomainhost.com support

#edit /etc/sysconfig/network and replace the parameter HOSTNAME with new hostname.

# reboot to make sure that it setup permanetly.

How to find which php.ini file is in use ?

Ans : php –i | grep php.ini

How I can kill all process accessimng /tmp partition

Ans : fuser –km /tmp

How would you rebuild your RPM database.

Ans : rpm –rebuilddb -v -v

How can you determine which shell you are using ?

Ans : echo $SHELL

Which UNIX command will control the default file permissions when files are created?

Ans : umask

What is difference between du and df command

Ans : du : The du utility displays the file system block usage for each file argument and for each directory in the file hierarchy rooted in each directory argument. If no file is specified, the block usage of the hierarchy rooted in the current directory is displayed. If the -k flag is specified, the number of 1024-byte blocks used by the file is displayed
df : df utility displays the amount of disk space occupied by mounted file systems(partitions), the amount of used and available space, and how much of the file system’s total capacity has been used. The file system is specified by device, or by referring to a file or directory on the specified

How to remove duplicate rpm?(use rpm command)

Ans : rpm -e –nodeps –allmatches

51) Biggest number that an IP address can have in any of its octet is ?

a) 256
b) 255
c) 264
d) 254

Ans : 255

What is a quick way to see all users with the UID of 0 on the shell ?

Ans : cat /etc/passwd| grep “:0:”

What is significance of Add_Module and Load_module in default httpd.conf

Ans : Load_module : The LoadModule directive links in the object file or library filename and adds the module structure named module to the list of active modules.

Module is the name of the external variable of type module in the file, and is listed as the module Identifier in the module documentation.

Add_module : The server can have modules compiled in which are not actively in use. This directive can be used to enable the use of those modules. The server comes with a pre-loaded list of active modules; this list can be cleared with the ClearModuleList directive.

You will find details information about it at http://httpd.apache.org/docs/1.3/mod/core.html

What is a simple method to stop the DDOS attack on a domain.

Ans : Changed the A record for domain to point to 127.0.0.1

Similar Posts:

4 comments on “Every tech suport should know this –Linux

  1. The permissions answer is wrong. Disabling WHM’s Compiler Access will result in "-rwxr-x—" which is 750.

Leave a Reply to admin Cancel reply

Your email address will not be published. Required fields are marked *