Beruflich Dokumente
Kultur Dokumente
Q: - Write a command to find all of the files which have been accessed within the last 30 days.
find / -type f -atime -30 > filename.txt
Q: - What is a zombie?
Zombie is a process state when the child dies before the parent process. In this case the structural
information of the process is still in the process table.
Q: - What daemon is responsible for tracking events on your system?
syslogd
Q: - What do you mean a File System?
File System is a method to store and organize files and directories on disk. A file system can have
different formats called file system types. These formats determine how the information is stored as
files and directories.
Q: - Tell me the name of directory structure hierarchy for Linux
/root
/boot
/bin
/sbin
/proc
/mnt
/usr
/var
/lib
/etc
/dev
/opt
/srv
/tmp
/media
Q: - What does /boot directory contains?
The /boot/ directory contains static files required to boot the system, such as the Linux kernel, boot
loader configuration files. These files are essential for the system to boot properly.
Q: - If some one deletes /boot directory from your server, than what will happen?
In that case your server will be in unbootable state. Your Server cant boot without /boot directory
because this directory contains all bootable files
Q: - What does /dev directory contain?
The /dev directory contains all device files that are attached to system or virtual device files that are
provided by the kernel.
Q: - What kind of files or nodes /dev/ directory contains and how do I access or see device
files?
Block Device Files:Block device files talks to devices block by block [1 block at a time (1 block = 512 bytes to 32KB)].
Examples: - USB disk, CDROM, Hard Disk
# ls /dev/sd*
brw-rw---brw-rw---brw-rw---brw-rw---brw-rw---brw-rw----
1 root
1 root
1 root
1 root
1 root
1 root
root
root
root
root
root
root
8,
8,
8,
8,
8,
8,
1 root
1 root
1 root
1 root
root
root
root
root
4,
4,
4,
4,
64 Mar 15
65 Mar 15
66 Mar 15
67 Mar 15
2009 ttyS0
2009 ttyS1
2009 ttyS2
2009 ttyS3
The ext3 file system is an enhanced version of the ext2 file system.
The most important difference between Ext2 and Ext3 is that Ext3 supports journaling.
After an unexpected power failure or system crash (also called an unclean system shutdown), each
mounted ext2 file system on the machine must be checked for consistency by the e2fsck program.
This is a time-consuming process and during this time, any data on the volumes is unreachable.
The journaling provided by the ext3 file system means that this sort of file system check is no longer
necessary after an unclean system shutdown. The only time a consistency check occurs using ext3 is
in certain rare hardware failure cases, such as hard drive failures. The time to recover an ext3 file
system after an unclean system shutdown does not depend on the size of the file system or the
number of files; rather, it depends on the size of the journal used to maintain consistency. The
default journal size takes about a second to recover, depending on the speed of the hardware.
Q: - Any idea about ext4 file system?
The ext4 or fourth extended file system is a journaling file system developed as the successor to
ext3. Ext4 file system released as a functionally complete and stable filesystem in Linux with kernel
version 2.6.28.
Features of ext4 file system:1. Currently, Ext3 supports 16 TB of maximum file system size and 2 TB of maximum file size. Ext4
have 1 EB of maximum file system size and 16 TB of maximum file size.
[An EB or exabyte is 1018 bytes or 1,048,576 TB]
2. Fast fsck check than ext3
3 In Ext4 the journaling feature can be disabled, which provides a small performance improvement.
4. Online defragmentation.
5. Delayed allocation
Ext4 uses a filesystem performance technique called allocate-on-flush, also known as delayed
allocation. It consists of delaying block allocation until the data is going to be written to the disk,
unlike some other file systems, which may allocate the necessary blocks before that step.
Q: - How we create ext3 file system on /dev/sda7 disk?
# mkfs j /dev/sda7
Q: - Can we convert ext2 filesystem to ext3 file system?
Yes, we can convert ext2 to ext3 file system by tune2fs command.
tune2fs j /dev/<Block-Device-Name>
Q: - Is there any data lose during conversion of ext2 filesystem to ext3 filesystem?
No
Q: - How we will create ext4 file system?
# mke2fs -t ext4 /dev/DEV
the partitions if they are of equal size. The performance of RAID 5 is based on parity calculation
process but with modern CPUs that usually is not a very big problem. In RAID 5 read and write
speeds are good.
Q: - Which kernel module is required for Software RAID?
md module
Q: - which utility or command is used for creating software RAIDs for RHEL5?
mdadm
Q: - Can we create software RAID during Linux installation?
Yes, we can create Software RAID during Linux Installation by Disk Druid
Q: - What is the role of chunk size for software RAID?
Chunk size is very important parameter on which RAID performance based.
We know stripes go across disk drives. But how big are the pieces of the stripe on each disk? The
pieces a stripe is broken into are called chunks.To get good performance you must have a reasonable
chunk size.
For big I/Os we required small chunks and for small I/Os we required big chunks.
Q: - What is SWAP Space?
Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system
needs more memory resources and the RAM is full, inactive pages in memory are moved to the swap
space. While swap space can help machines with a small amount of RAM, it should not be
considered a replacement for more RAM. Swap space is located on hard drives, which have a slower
access time than physical memory.
- Create swap partition or file
- Write special signature using mkswap
- Activate swap space by swapon a command
- Add swap entry into /etc/fstab file
Q: - How you will create swap file of size 4 GB and explain swap file entry in /etc/fstab file?
Use dd command to create swap file.
dd if=/dev/zero of=/SWAPFILE bs=1024 count=4
mkswap /SWAPFILE
swapon a
Entry into /etc/fstab file.
/SWAPFILE swap swap defaults 0 0
Q: - Tell me the steps to remove the swap file?
Firstly disable the swap file by swapoff command.
Remove Swap file entry from /etc/fstab file.
Now remove the swap file by rm command.
Q: - What can we do with parted command or utility?
- View the existing partition table
- Add partitions from free space or additional hard drives
- Change the size of existing partitions
Q: - How we will check free space on drive /dev/sda with parted command?
#parted /dev/sda
print
Q: - Tell me the steps to remove the swap file?
Firstly disable the swap file by swapoff command.
Remove Swap file entry from /etc/fstab file.
Now remove the swap file by rm command.
- View the existing partition table
- Add partitions from free space or additional hard drives
- Change the size of existing partitions
Q: - How we will check free space on drive /dev/sda with parted command?
#parted /dev/sda
print
Q: - If a volume group VG0 have 3 PV's (/dev/sda6, /dev/sda7, /dev/sda8) but i want to
remove /dev/sda7 pv from this VG0?
vgreduce VG0 /dev/sda7
Q: - Which command is used to extend a logical volume?
lvextend --size +<addsize> /dev/<vgname>/<lvname>
resize2fs /dev/<vgname>/<lvname>
Q: - Tell me all steps to remove a LVM?
To remove a logical volume from a volume group, first unmount it with the umount command:
umount /dev/<vgname>/<lvname>
and then use the lvremove command:
lvremove /dev/<vgname>/<lvname>
Q: - Which command is used to create LVM Snapshot?
vcreate --size <size> -s -n <snapshotname> <lvname>
The lvcreate command is used to create a new logical volume, meaning there must be
free physical extents in the logical volume group to create a snapshot. The -s option
means that the LV is a snapshot, <snapshotname> is the name of the new LV created, and
<lvname> is the name of the LV from which to create the snapshot.
Q: - Is there any relation between modprobe.conf file and network devices?
Yes, This file assigns a kernel module to each network device.
For Example :[root@localhost ~]# cat /etc/modprobe.conf
alias eth0 b44
Here b44 is the kernel module for network device eth0.
We can Confirm by following command (This module b44 is present or not).
[root@localhost ~]# lsmod |grep b44
b44
29005
Q: - What is the location of "network" file and what does this contains?
location :- /etc/sysconfig/network
This file contains following fields
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
Q: - What is the role of /etc/resolv.conf file?
In this file we sets the DNS servers (using their IP addresses) and the search domain. The values of
the DNS servers are often added when the network is activated because the data can be provided by
DHCP or a similar service.
Q: - Which deamon is required to start Network services?
network
/etc/init.d/network start
Q: - What "neat" command will do?
neat command provides Graphical interface to change network settings for network devices.
Q: - Which protocol is required to allow local printing and print sharing?
Internet Printing Protocol (IPP) is required to allow local printing and print sharing.
Q: - What is CUPS?
CUPS stands for "Common UNIX Printing System". CUPS is a open source printing system
developed by Apple Inc. CUPS uses the Internet Printing Protocol (IPP) to allow local printing and
print sharing.
Architecture hardware and is RPM-based, just like Red Hat Enterprise Linux and Fedora. YUP, and
later YUM, were written by the Linux community as a way to maintain an RPM-based system.
Q: - What are the advantages of YUM?
- Automatic resolution of software dependencies.
- Multiple software locations at one time.
- Ability to specify particular software versions or architectures.
Q: - Which configuration file is required to change the Run Level of Server or system?
/etc/inittab
To change the default run level, modify this line.
id:5:initdefault:
Q: - Explain architectures required for RPMs?
noarch Architecture-independent, can run on any architecture
i386 Generic build for a 32-bit x86 system
i586 Sometimes used when building kernels for older x86 processors
Intel Pentium II, Intel Pentium III, Intel Pentium 4, AMD Athlon, and
i686 AMD Duron systems (Most RPMs for these architectures are built using the i386 architecture,
with the kernel for these architectures being built with the
i686 for optimal performance.)
x86_64 64-bit processors such as AMD Athlon64, AMD Opteron, and Intel EM64T
ia64 Intel Itanium
ppc
32-bit IBM POWER, IBM eServer pSeries, and IBM eServer iSeries
/home
ext3
acl
1 2
# passwd <username> -u
Q: - How to detect CPU architecture/bitmode (32-bit or 64-bit) for Linux ?
# cat /proc/cpuinfo | grep flags
you will find one of them with name "tm(transparent mode)" or
"rm(real mode)" or "lm(long mode)"
1. rm tells ,it is a 16 bit processor
2. tm tells, it is a 32 bit processor
3. lm tells, it is a 64 bit processor
Q: - What is the difference between SSH and Telnet ?
The Primary difference between SSH and Telnet is of security i.e in ssh data transfer between the
systems is in encrypted form so it is difficult for the hackers to understand what is going on network.
In Telnet data transfer between the systems is in plain text.
SSH uses a public key for authentication while Telnet does not use any authentication.
Due to the security measures that were necessary for SSH to be used in public networks, each packet
contains less data to make room for the data of the security mechanisms. In order to transmit the
same amount of data, you would need to take-up a lot more bandwidth. This is called overhead..
SSH adds a bit more overhead to the bandwidth compared to Telnet.
Q: - What is difference between AT and CRON?
Cron command is used to schedule the task daily at the same time repeatedly ,
at command is used to schedule the task only once i.e to run only one time.
A connection is established
The NFS retry threshold is met
The nfstimeout value is reached
Q: - What is an inode ?
An inode is a data structure on a traditional Unix-style file system such as UFS. An inode stores
basic information about a regular file, directory, or other file system object.
When a file system is created, data structures that contain information about files are created. Each
file has an inode and is identified by an inode number (often "i-number" or even shorter, "ino") in the
file system where it resides. Inodes store information on files such as user and group ownership,
access mode (read, write, execute permissions)
and type of file. There is a fixed number of inodes, which indicates the maximum number of files
each filesystem can hold.
Q: - What is the role of udev daemon in Unix ?
udev is the device manager for the Linux 2.6 kernel series. Primarily, it manages device nodes in
/dev. It is the successor of devfs and hotplug, which means that it handles the /dev directory and all
user space actions when adding/removing devices, including firmware load.
Size
Status
Information about other metadata structures
NFS
Q: - Explain this entry /shared 192.168.1.0/255.255.255.0(sync,rw)
allows all systems with 192.168.1.* IP addresses read-write access to the /shared/ directory:
Q: - What will happened if a space is given inbetween allowed_hosts and (options)
If a space is included, the options are applied to any and all IP addresses, which can be quite
dangerous if write permission is granted.
Q: - What is the role of "sync" option for NFS server
If sync is specified, the server waits until the request is written to disk before responding to the
client. The sync option is recommended because it follows the NFS protocol.
Q: - How to retrieve a list of clients connected to the NFS server ?
To retrieve a list of clients connected to the NFS server, use the showmount command
from a shell prompt. To also show the directories the clients are connected to, use the
showmount -a command.
Q: - Name of Configuration file for NFS Server ?
/etc/exports
Q: - What is meaning of "no_root_squash" option ?
Treat remote root user as local root. Do not map requests from root to the anonymous user and group ID.
Q: - What is NFS?
NFS stands for Network File System. NFS was originally developed by Sun Microsystems in the
1980's. NFS allows remote hosts to mount file systems over a network and interact with those file
systems as though they are mounted locally. This enables system administrators to consolidate
resources onto centralized servers on the network.
Q: - Which NFS versions are available ?
NFS Version 2
NFS Version 3
NFS Version 4
Q: - What is different between NFS Version 2 & 3 ?
nfs 2 default 8kb transfer rate,it did not check the authentication at the time connection.client wants
to access unauthorized file it shows error messages like "write error","read error" nfs 3 32kb transfer
rate. It checks at the time connection- ACL Support
Q: - Can we grant access by Username and password for nfs share?
No, access is granted only for IP address.
Q: - What is the role of "all_squash" option?
Treat all client users as anonymous users. Map all user and group IDs to the anonymous user and
group ID.
Q: - What is the role of "root_squash" option?
All requests from the user root are translated or mapped as if they came from the user anonymous
(default).
Q: - Explain option "all_squash"?
The UID and GID of exported files are mapped to the user anonymous. It is good for public
directories.
Q: - Explain "exportfs" command?
The exportfs command is used to maintain the current table of exported file systems for NFS.
Q: - Explain command "/usr/sbin/exportfs -f"?
It will flush everything out of the kernels export table. Any clients that are active will get new entries
added by mountd when they make their next request.
Q: - Which option is used with exportfs command to display the current export list, also
displays the list of export options?
exportfs -v
Q: - Which option is used with exportfs command to re-export all directories?
exportfs -r
Q: - How you will export directory (/data) to host 192.168.1.51, allowing asynchronous writes
without adding the entry in /etc/exports file?
mount-point
/mnt
fs-type
nfs
options
rw
dump fsckorder
0
FTP
Q: - How to deny specific users access to the FTP server?
To deny specific users access to the FTP server, add their usernames to the /etc/vsftpd/
ftpusers file. By default, system users such as root and nobody are included in this list.
Q: - What is FTP ?
FTP client connects to the FTP server by establishing an FTP control connection to port 21 of the
server. Your commands such as 'ls' and 'get' are sent over this connection. Whenever the client
requests data over the control connection, the server initiates data transfer connections back to the
client. The source port of these data transfer connections is always port 20 on the server, and the
destination port is a high port (greater than 1024) on the client.
Q: - What is Passive mode?
Passive mode, like active mode, is initiated by the FTP client application. When requesting data from
the server, the FTP client indicates it wants to access the data in passive mode and the server
provides the IP address and a random, unprivileged port (greater than 1024) on the server. The client
then connects to that port on the server to download the requested information.
sense to edit these databases on the secondary name servers, although they are saved on the local
server disk because they will be rewritten during further copying.
Q: - what is Root name server?
Root name server is an authoritative name server for the root domain (for the dot). Each root name
server is a primary server, which differentiates it from other name servers.
Q: - what is Stealth name server?
Stealth name server is a secret server. This type of name server is not published anywhere. It is only
known to the servers that have its IP address statically listed in their configuration. It is an
authoritative server. It acquires the data for the zone with the help of a zone transfer. It can be the
main server for the zone. Stealth servers can be used as a local backup if the local servers are
unavailable.
Q: - What do you mean by "Resource Records"?
Information on domain names and their IP addresses, as well as all the other information distributed
via DNS is stored in the memory of name servers as Resource Records (RR).
Q: - Explain "TTL"?
Time to live. A 32-bit number indicating the time the particular RR can be kept valid in a server
cache. When this time expires, the record has to be considered invalid. The value 0 keeps
nonauthoritative servers from saving the RR to their cache memory.
Q: - Tell me 5 Types of DNS records?
A, NS, CNAME, SOA, PTR, MX.
Q:- explain "SOA Record"?
The Start of Authority (SOA) record determines the name server that is an authoritative source of
information for the particular domain. There is always only one SOA record in the file, and it is
placed at the beginning of the file of authoritative resource records.
Q: - what is "A Record"
A (Address) records assign IP addresses to domain names of computers. The IP address cannot have
a dot at the end.
Q: - Explain "CNAME Record"?
Synonyms to domain names can be created using CNAME records. This is often referred to as
'creating aliases for computer names'.
SAMBA
Q: - Which SELinux security context used for SAMBA ?
samba_share_t
Q: - On which ports SAMBA server works ?
- UDP port 137 for netbios-ns, the NETBIOS Name Service
- UDP port 138 for netbios-dgm, the NETBIOS Datagram Service
- TCP port 139 for netbios-ssn, the NETBIOS session service
- TCP port 445 for microsoft-ds, the Microsoft Domain Service
Q: - What are the Secrity or Authentication Mode for SAMBA server?
ADS
DOMAIN
SERVER
USER
SHARE
Q: - How to Manually Create Machine Trust Accounts ?
/usr/sbin/useradd -g machines -d /var/lib/nobody -c "machine nickname" -s /bin/false
machine_name$
passwd -l machine_name$
Q: - What are the SAMBA server Types ?
- Primary Domain Controller (PDC)
Q: - Can Samba fully replace my Windows NT server that is not a Primary Domain
Controller (PDC)?
Samba can completely serve files and printers to Windows, just as a Windows NT server would.
Q2 Can Samba replaces my Windows NT PDC?
Not completely. Samba domain control capabilities for a Windows 9x client are
solid and complete, and so these clients would probably never know the difference. The domain
control support for Windows NT/2000 clients is still being developed. Currently, enough has been
implemented to allow a Windows NT client to join a Samba-controlled domain, but there is more to
domain control than that. The most conspicuous absence is the lack of support for Windows NT trust
relationships and the SAM replication protocol used between NT PDCs and Backup Domain
Controllers (BDCs).
Q3 What TCP and UDP ports required for NetBIOS over TCP/IP use?
The NBT name service uses port 137/udp, the NBT session service uses port
139/tcp, and the NBT datagram service uses port 138/udp.
Q: - How SMB protocol works?
There will be three stages in creating an SMB connection between a client and a specific share on a
server.
The first stage in connecting to an SMB share is to negotiate the SMB protocol dialect to use. In the
request packet, the client sends a text listing of all the SMB dialects that it understands. The server
selects the most advanced protocol that it knows and responds to the client, specifying the protocol
number from the list. At this point, the client and server have agreed that SMB commands can be
used for the remainder of the conversation.
The second stage is to create a session connection between the client and server. To do this, the client
issues a session setup request, which includes a sername and some proof of validity, such as a
password. The server attempts to validate requesting user. If successful, the server then returns a
session UID to client. This UID is unique for each session and has no relation to the server internal
representation of users.
The third stage before access to files on a remote share is allowed is for the client to make a
successful tree connection to the shared resource. The client sends to the server a tree connect
request, which includes the UID previously issued by the server. At this stage the server verifies that
the authenticated user is authorized to access the requested resource. If the user has sufficient
privileges to access the share, the client is issued a tree connection ID (TID). The TID is used in all
requests to access files contained in the resource to which the TID refers.
In this way SMB protocol works.
Q: - How man sections samba configuration file (smb.conf) contains?
smb.conf file contains three sections.
1. [global] Contains settings that determine Samba overall behavior.
2. [homes] A default share for providing a home directory for all users.
3. [printers] A default share for exporting all printers on the host via CIFS.
Q: - If a netbios name is not defined in smb.conf, than what will be netbios name?
If a netbios name is not defined, Samba will use the IP hostname of the server by default.
Q: - I want to use User level security for my samba server than what i have to add in smb.conf
file?
security = user
Q: - How you will verify that your smb.conf file doesnt have any mistakes and misspellings?
"testparm " tool that verifies the syntax of a configuration file(smb.conf).
testparm -s smb.conf
Q: - What is the use of "smbclient" command?
"smbclient" is used to display the list of shares on your server. This verifies that smbd is running and
functioning correctly. The -L option instructs smbclient to enumerate the shares on the server rather
than actually connecting to one. The -N switch instructs smbclient to use an anonymous login
rather than the login name of the current user.
smbclient -L localhost -N
Antother use of "smbclient" command to connect the samba share.
smbclient //<server>/<share> -U <username>
Q: - What is SWAT?
SWAT is GUI Based administration tool for samba server.
Q: - I am trying to use SWAT, but I keep getting the message There was no response. The
server could be down or not responding. What is the problem?
The most likely cause is that SWAT is not listening to connections, or you have used the wrong URL
in trying to connect to SWAT. SWAT usually lives behind port 901, so the URL you should use is
http://ID_ADDRESS_OF_SERVER:901/
Q: - Can i set empty password for samba user?
yes, If you want to set the value to an empty password, you must change
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXX
to
NOPASSWORDXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXX
in your smbpasswd file.
Note: - if you have edited the smbpasswd file by hand, make sure that the LAN Manager and NT
password fields contain exactly 32 characters, no more and no fewer. If these fields do not have
exactly 32 characters, Samba will not be able to correctly read the entry.
or You can modify by "smbpasswd" command.
smbpasswd -n USER_NAME
Also you have to set the null passwords parameter to yes in the [global] section of smb.conf:
null passwords = yes
Q: - Does Samba support PAM?
Yes
Q: - What is role of "NTLM"?
The challenge/response authentication protocol available to Windows clients and servers for
validating connection requests.
This daemon handles all TCP/IP-based connection services for file- and print-based operations. It
also manages local authentication. It should be started immediately following the startup of nmbd.
Q: - What is winbindd daemon?
This daemon should be started when Samba is a member of a Windows NT4 or ADS domain. It is
also needed when Samba has trust relationships with another domain. The winbindd daemon will
check the smb.conf file for the presence of the idmap uid and idmap gid parameters. If they are
found, winbindd will use the values specified for UID and GID allocation. If these parameters are
not specified, winbindd will start but it will not be able to allocate UIDs or GIDs.
Q: - Explain the parameter "wins support = Yes" used in smb.conf?
If the Samba server was configured to provide WINS support ("wins support = Yes"), then the WINS
server is able to provide name resolution for all of the hosts that are not listed in the /etc/hosts file or
within the DNS. Making this adjustment in the Name Service Switch configuration file
(/etc/nsswitch.conf) allows the Linux system to query the WINS server for local name resolution.
This saves manual adjustments to host files.
Q: - How to automate SMB share mounting during system startup?
Add smb share entry in /etc/fstab file.
//IP_ADDRESS_OF_SERVER/Shared /shared
smbfs
noauto,defaults 0 0
QMAIL
Q: - Which qmail process use "concurrecylocal" control file ?
qmail-send
Q: - What is maildir ?
Maildir is a mailbox format created by Dan Bernstein to address the shortcomings of the mbox
format. A maildir mailbox is a directory containing three subdirectories, new, cur, and tmp. Each
message in a maildir mailbox is in a separate file in one of the subdirectories, depending upon its
status: new is for unread messages, cur is for messages that have been seen, and tmp is for messages
in the process of being delivered.
Q: - What is procmail ?
procmail is a popular Message Delivery Agent (MDA). The function of an MDA is to accept a
message from the MTA for a specific user or mailbox, and deliver the message according to the
user's desires. procmail can be used to "filter" messages by the content of various header fields or the
body of the message.
Q: - Which Groups and Users are required to start QMAIL Server ?
Groups :- nofiles
qmail
Users :- qmaild
alias
qmaill
qmailp
qmailq
qmailr
qmails
Q: - What is the role of "qmail-send" process ?
qmail-send - deliver mail messages from the queue
Q: - How to check, qmail server is up or down ?
We can use qmailctl command to check the status of qmail server.
# qmailctl stat
/service/qmail-send: up (pid 30303) 187 seconds
/service/qmail-send/log: up (pid 30304) 187 seconds
/service/qmail-smtpd: up (pid 30305) 187 seconds
/service/qmail-smtpd/log: up (pid 30308) 187 seconds
messages in queue: 0
messages in queue but not yet preprocessed: 0
Q: - What is QMAIL ?
qmail is a mail transfer agent that runs on Unix/Linux. It was written, starting December 1995, by
Daniel J. Bernstein as a more secure replacement for the popular Sendmail program. qmail's source
code is released to the public domain, making qmail free software.
Q: - What is Courier-imap ?
A server that provides IMAP access to Maildir mailboxes. This IMAP server does NOT handle
traditional mailbox files (/var/spool/mail, and derivatives), it was written for the specific purpose of
providing IMAP access to Maildirs.
Q: - What is the location of qmail control files ?
/var/qmail/control
Q: - Tell me the name of five Important Qmail daemons?
qmail-queue
qmail-send
qmail-clean
qmail-lspawn
qmail-rspawn
qmail-local
qmail-remote
Q: - Explain the working of qmail?
For mail arriving from remote systems, tcpserver runs as a daemon listening for incoming
connections on the SMTP port. Each time a connection arrives, it runs qmail-smtpd, which receives a
message via SMTP and calls qmail-queue to queue the message. Regardless of where the message
originates, qmail-queue writes the message to a temporary file in the queue/todo directory, putting a
new Received: line at the top, and also saves the envelope sender and recipient addresses to files.
Then it notifies qmail-send by writing a byte to a "trigger" socket file. qmail-send takes the message
out of queue/todo, and analyzes each recipient address to see if it's local, remote, or virtual. For local
addresses, it notifies qmail-lspawn to run qmail-local to do the local deliveries. For each remote
address, qmail-send notifies qmail-rspawn to run qmail-remote to do the remote deliveries. For
virtual addresses, qmail-send rewrites each virtual address as a modified local address, using the
information from the virtualdomains files.
Q: - What is ucspi-tcp?
A package for servers that respond to incoming TCP connections, as an alternative to the old inetd
daemon. It used to be optional, but its tcpserver is now the only supported way to run qmail's SMTP
daemon.
Q: - What is checkpassword?
If you're using qmail's built-in POP3 server, you want Dan's checkpassword program, which
validates user logins as well. Even if you're installing an alternative checkpassword, it's nice to have
Dan's checkpassword installed for testing.
Q: - Which Mailbox Format is used by Qmail?
Qmail supports two mailbox formats: the traditional mbox and Dan's newer Maildir.
Q: - Explain qmail control file me?
The name of this host, e.g., mail.test.com. This provides the default to use for many other
configuration files.
Q: - Explain about qmail control file locals?
Domain names to be delivered locally, one per line. Mail to any domain listed in locals is delivered
by treating the mailbox part as a local address. This usually contains the name of the host and the
name of the domain used for user mailboxes, such as test.com and mail.test.com.
Q: - Explain about qmail control file rcpthosts?
Domains for which this host should accept mail via SMTP. This generally contains all of the
domains in locals, as well as any virtual domains and any domains for which this host is a backup
mail server. If rcpthosts does not exist, qmail accepts and delivers mail for any domain, a severe
misconfiguration known as an "open relay," which will be hijacked by spammers. Be sure your
rcpthosts file exists before starting qmail. If you haven't defined any virtual domains, just copy
locals to rcpthosts.
Q: - Explain about qmail control file badmailfrom?
This qmail control file is used by qmail-smtpd. Envelope addresses not allowed to send mail. If the
envelope from address on an incoming message matches an entry in badmailfrom, the SMTP
daemon will reject every recipient address. Entries may be either email addresses, or @domain to
reject every address in a domain. This is a primitive form of spam filtering.
Q: - What is the use of bouncefrom qmail control file?
This qmail control file is used by qmail-send daemon. This file contains the mailbox of the return
address to put in bounce messages.
Q: - What is use of concurrencylocal qmail control file?
This qmail control file is used by qmail-send daemon. This file contains the maximum number of
simultaneous local deliveries. The default value is 10.
Q: - What is use of concurrencyremotel qmail control file?
This qmail control file is used by qmail-send daemon. This file contains the maximum number of
simultaneous remote deliveries. The default value is 20.
Q: - What is the use of queuelifetime qmail control file?
This qmail control file is used by qmail-send daemon. In this file we define how long to keep trying
to deliver a message. The default value is 604800 seconds (a week).
Q: - What is the use of timeoutconnect qmail control file?
This qmail control file is used by qmail-remote daemon. In this file we define how long to wait for a
remote server to accept the initial connection to send mail. The default value is 60 seconds.
Q: - What is the use of virtualdomains qmail control file?
The list of virtual users and domains for which this system receives mail. The default value in this
file is none.
Q: - How to rebuild the SMTP access database?
qmailctl cdb
or
tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
chmod 644 /etc/tcp.smtp*
Email-ID: -arun.san85@yahoo.com
Q: - What is maildrop?
Maildrop is a mail filtering agent which can be used to filter messages as they arrive on the server.
Q: - What is Qmailadmin?
Qmailadmin is going to provide us with a nice web based interface for administering mail accounts
once they are setup through Vpopmail (or Vqadmin). From Qmailadmin we can create mailboxes,
aliases, forwards, mail robots, mailing lists.
Q: - Which antivirus you have used with Qmail?
ClamAV antivirus
Q: - Where Clam AV quarantines the e-mails?
Clam AV quarantines the e-mails in /var/spool/qmailscan/quarantine
Q: - By which user we run ClamAV?
qscand user
Q: - Can I have Spamassassin tag suspected spam with a custom subject line?
Yes. Edit the /var/qmail/bin/qmail-scanner-queue.pl file and find the following line:
my $spamc_subject=`:SPAM:`;
Now type a custom spam subject. This subject line will be added to any mails that Spamassassin tags
as suspected spam. Here's an example:
my $spamc_subject=`This is Spam Mail`;
Q: - When compiling qmail, I get the following error:
qmail-remote.c:36: openssl/ssl.h: No such file or directory
what' s wrong there?
openssl and libssl-dev packages are required for qmail compiling.
Check these packages are installed or not
Q: - How can I disable qmail from conducting reverse DNS lookups on SMTP connections?
This can be done by adding a "-H" flag to the tcpserver call within the qmail-smtpd supervise script.
/usr/local/bin/tcpserver -v -R -H -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \
Q: - I am running qmail-scanner with Spamassassin and ClamAV. When I run the qmailscanner test script or when I view my logs, I see the following error: qmail-inject: fatal: qq
temporary problem Bad error. qmail-inject died
This can be fixed by raising the "softlimit" setting within the /var/qmail/supervise/qmail-smtpd file.
Q: - I'm getting the following error concerning Vpopmail: configure: error: No vpopmail
etc/lib_deps file. Upgrade to vpopmail-4.9.8 or above.... What's wrong?
This error is usually caused when installing Vpopmail over a previous Vpopmail installation. Try
completely removing the /home/vpopmail directory and then install a fresh copy of Vpopmail. That
should clear it up.
Q: - When I test qmail-scanner, I get an error that states: "can't do suid". What's wrong?
Your server is not set up to allow for setuid execution of scripts. The easiest way to fix this is to
install the "perl-suidperl" package. If you're running Redhat, you can download the latest RPM of
perl-suidperl.
POSTFIX
Once the valid message is rewritten and placed in the incoming message queue, the qmgr program
ensures that the message is delivered to the proper destinations. The qmgr program then examines
message headers and passes them to the appropriate delivery program depending on the destination
addresses. Currently, the qmgr program can forward messages to the local, smtp, and pipe programs.
Q: - Tell me about latest Version of Postfix on which u have worked ?
postfix 2.6
Q: - What are the important files for postfix server ?
/etc/postfix/main.cf
/etc/postfix/access
/etc/postfix/aliases
Q: - Where postfix mail server logs created ?
/var/log/maillog
Q: - Explain the working of local mail submission for postfix?
When a local email message enters the postfix system. Local messages are deposited into the
maildrop directory of the Postfix queue by the postdrop command, usually through the sendmail
compatibility program. The pickup daemon reads the message from the queue and feeds it to the
cleanup daemon. The cleanup daemon processes all inbound mail and notifies the queue manager
after it has placed the cleaned-up message into the incoming queue. The queue manager then invokes
the appropriate delivery agent to send the message to its next hop or ultimate destination.
Q: - What are the benefits of using SMTP AUTH?
- Using SMTP AUTH we can make it possible for clients, colleagues, and ourselves to relay
messages from everywhere in the world using only one (our) SMTP server.
- Being a mobile user, we don't have to deal with the hassle to find a SMTP server that permits us to
relay.
- We can make use of scripts and daemons that run on our server and provide services that we need
e.g. server-side virus scanning.
Q: - by using postconf command, how you will set fully qualified hostname (mail4.test.com)?
# postconf -e myhostname=mail.example.com
The -e option tells postconf to edit the configuration with the parameters and values specified.
Q: - Which command checks for configuration problems?
# postfix check
Q: - How you will see the queue of postfix server?
#postqueue p
Q: - How can I clear postfix mail server queue?
# postsuper -d ALL
Q: - How you will reload the postfix queue?
# postsuper -r ALL
Submitted By:-Amit
Email-ID: -amitk7676@gmail.com
The smtpd_recipient_limit parameter can limit the number of recipients allowed in a single incoming
message.
The default value for this parameter is 1000.
Q: - Explain smtpd_timeout Parameter?
The smtpd_timeout parameter limits the amount of time Postfix waits for an SMTP client request
after sending a response. This allows the Postfix administrator to quickly disconnect SMTP servers
that camp out on the SMTP connection, utilizing system resources for the SMTP connection
without actually sending a message.
smtpd_timeout = value
By default, Postfix will assume the value is in seconds.
Q: - Explain queue_run_delay Parameter?
The queue_run_delay parameter sets the time interval (in seconds) that Postfix scans the deferred
message queue for messages to be delivered. The default value for this is 1,000 seconds.
Q: - Explain maximal_queue_lifetime Parameter?
The maximal_queue_lifetime parameter sets the amount of time (in days) that a message remains in
the deferred message queue before being returned as undeliverable. The default value is 5 days.
Once this value is reached, Postfix returns the message to the sender.
Q: - Explain minimal_backoff_time Parameter?
The minimal_backoff_time parameter sets one value that has two uses: the minimum amount of time
used to hold a message in the deferred message queue and the minimum amount of time for which a
host can be marked unreachable. The default value for this parameter is 1,000 seconds.
Q: - Explain maximal_backoff_time Parameter?
The maximal_backoff_time value sets an upper limit to the amount of time a message is left in the
deferred message queue without a delivery attempt. The default value for this parameter is 4,000
seconds.
Q: - Explain default_destination_concurrency_limit Parameter?
The default_destination_concurrency_limit parameter defines the maximum number of concurrent
SMTP sessions that can be established with any remote host. This parameter is related to the SMTP
maxprocess parameter in the master.cf configuration file. The maximum number of concurrent
SMTP sessions cannot exceed the maxprocess value set for the maximum number of SMTP client
Yes, you can have two different apache servers on one server, but they can't listen to the same port at
the same time.Normally apache listens to port 80 which is the default HTTP port. The second apache
version should listen to another port with the Listen option in httpd.conf, for example to port 81.
For testing a new apache version before moving your sites from one version to another, this might be
a good option.You just type www.example.com:81 in the browser window and you will be connected
to the second apache instance.
LDAP SERVER
Q: - Is there Graphical editors for LDAP?
Yes, Following are some GUI based tools for LDAP
- GQ
- Java LDAP Browser/Editor
- Softerra LDAP Browser
Q: - What can i do if my application doesn't speak to LDAP ?
Gateway that translate one directory access protocol into another.
Q: - How can i join information contained in different directories ?
Distributed, Multivendor directories glued together by referrals and references.
Q: - What is "LDIF" ?
The LDAP Interchange Format (LDIF) is a standard text file format for storing LDAP configuration
information and directory contents. LDIF files are often used to import new data into your directory
or make changes to existing data.
Q: - Name the object class types ?
- Structural Object class
- Auxiliary Object class
- Abstract object classes
Q: - What is the name of main configuration file name for LDAP server ?
slapd.conf
Q: - What is LDAP ?
LDAP stands for Lightweight Directory Access Protocol. In plain and simple terms, its a database
whereby it has all the details of all of organizations, individuals, and other resources such as files and
devices in a network, whether on the Internet or on corporate intranetand whether or not you know
the domain name, IP address, or geographic whereabouts. An LDAP directory can be distributed
among many servers on a network, then replicated and synchronized regularly. An LDAP server is
also known as a Directory System Agent (DSA). Its a not a relational database. Outlook and other
email programs uses LDAP to search for a recipient in an organization.
Q: - Whats the relation ship between LDAP and JNDI?
JNDI has classes provided by SUN that will help ur appln interact with and LDAP server. JNDI
appln work similarly to JDBC applns once and be free to use 'drivers' from different vendors. SUN
provides the "driver" that will help interact with the LDAP server. Sun also provides "drivers" for
other naming services (like CORBA).
Q: - Why LDAP is called light weight?
LDAP (Lightweight Directory Access Protocol) is a protocol for communications between LDAP
servers and LDAP clients.
LDAP servers store "directories" which are access by LDAP clients.
LDAP is called lightweight because it is a smaller and easier protocol which was derived from the
X.500 DAP
(Directory Access Protocol) defined in the OSI network protocol stack.
Q: - what is SLAPD?
SLAPD stands for Stand-Alone LDAP.Clients connect to the server over the LDAP protocol, usually
using a network-based connection (though SLAPD provides a UNIX socket listener).
Q: - Which daemons are required for LDAP server?
slapd and slurpd
Q: - Tell me the name of three LDAP Client utilities or Applications
ldapsearch
ldapadd
ldapmodify
Q: - Define Schemas?
Schemas provide definitions of the different object classes and attribute types that OpenLDAP
should support. Using these, OpenLDAP can determine what entries it is allowed to store, whether
any given entry is valid, and how entries should optimally be stored.
Email-ID: -rk.rickey54@gmail.com
SQUID
Q: - On Which port Proxy server work ? Can we change proxy server port ?
By default proxy server runs on 3128 port. yes we can change proxy server port.
vi /etc/squid/squid.conf
http_port 3128
Q: - How to block Some domains by Squid server ?
Make a file
vi /etc/squid/bad_domains
.xxx.com
.abcd.com
.sexy.com
Now make following changes in Squid.conf file
acl BAD_DOMAINS dstdom_regex -i "/etc/squid/bad_domains"
http_access deny BAD_DOMAINS
Q: - How to clear Cache in Squid proxy?
Firstly stop squid server.
Service squid stop
rm -rf /var/lib/squid/cache/*
squid -z
dmesg command displays the system messages contained in the kernel ring buffer. By
using this command immediately after booting your computer, you will see the boot messages.
3. Which file contains User Information
Ans:The
/etc/passwd file contains all the information on users who may log into your system. If a
user account is not contained in this file, then the user cannot log in.
4. You have a technician who will come in after hours to install new hardware in your system. You
do not want to give him the root password, but he needs to be able to shutdown the system. How
can you accomplish this?
Choose one:
Ans:Any
user who is listed in the /etc/shutdown.allow file will be able to run the shutdown
command without being root.
5.
Linux can be installed on two partitions, one as / which will contain all files and a swap
partition.
Ans:
Only two partitions / and /boot are required, because in systems which have sufficient RAM you
don't really need the /swap partition as we all know that the reason for having
the swap partition.
6. In order to improve your system's security you decide to implement shadow passwords. What
command should you use?
Pwconv
The pwconv command creates the file /etc/shadow and changes all passwords to 'x' in the
/etc/passwd file.
7. You also need to know the amount of free space on the partition containing the users' home
directories. Which of the following commands will provide this information?
Ans: The df command reports on the amount of used and free space of the partition
the designated directory.
containing
8. You have created special configuration files that you want copied to each user's home directories
when creating new user accounts. You copy the files to /etc/skel. Which of the following commands
will make this happen?
Ans. Using the -m option with the useradd command will cause the home directory to be created.
The -k option will copy files and directories contained in /etc/skel to the user's home directory with
the appropriate permissions.
9. What are the common problems with threads?
Ans: Problems with threads originate from a classic view and its intrinsic concurrency complexity.
10. You changed the GID of the sales group by editing the /etc/group file. All of the members can
change to the group without any problem except for Joe. He cannot even login to the system. What is
the
problem?
Choose one:
Ans: if a user has a GID listed that is not a valid group in the /etc/passwd file, he will not be able to
log into the system.
11. You want to ensure that your system is not overloaded with users running multiple scheduled
jobs. A policy has been established that only the system administrators can create any scheduled
jobs. It is your job to implement this policy. How are you going to do this?
Ans: The crond daemon will examine the file /etc/cron.allow whenever a user attempts to install a
cron job. If that user's name is not in the file, he will not be able to install the cron job.
12. You have made changes to the LILO configuration file but you are not sure the changes will
work. How can you test the new configuration without installing it?
Choose one:
Ans: If you call LILO with the -t option, it will test your configuration without installing it.
13. You have set quotas for all your users but half of your users are using more space than they have
been allotted. Which of the following could be the problem?
Choose one:
Ans; Quotas are set on a partition by partition basis. If your users have home directories on different
partitions, you will need to configure quotas for each partition.
14. You need to locate a file called salesdata that one of your user's created in his home directory but
you do not know which one. How could you use the find command to locate this file?
Ans: find /home -name salesdata
When using the find command to locate a file by name you must specify the starting place in the
directory heirarchy and the -name option to specify the file to search for.
15. You wish to create a link to the /data directory in bob's home directory so you issue the command
ln /data /home/bob/datalink but the command fails. What option should you use in this command
line to be successful.
Ans: Use the -F option
In order to create a link to a directory you must use the -F option.
OR
you can use the command, ln -s /data /home/bob/datalink
16. What are the Disk Space Requirements for Minimal, Server, and Workstation Use?, and What are
the Minimum and Maximum Memory Requirements?.
Ans: Intel CPU, PC-compatible machines require at least an 80386 processor to run the standard
Linux kernel.Linux, including the X Window System GUI, runs on most current laptops.
17. What command can you use to see the boot messages?
Ans. The dmesg command will display the messages from the kernel that were recorded in
/var/log/messages.
18. You suspect that you have two commands with the same name as the command is not producing
the expected results. What command can you use to determine the location of the command being
run?
Ans: which
The which command searches your path until it finds a command that matches the command you are
looking for and displays its full path.
19. You want to create a compressed backup of the users' home directories. What utility should you
use?
Ans: tar
You can use the z modifier with tar to compress your archive at the same time as creating it.
20. What key combination can you press to suspend a running job and place it in the background?
Ans: ctrl-z
Using ctrl-z will suspend a job and put it in the background.
31. You have two files in two different directories with the same inode. What type of link is involved?
Ans : Hard links all have the same inode number, unlike symbolic links.
32. Which file do you edit to set partitions to mount at boot time?
Ans: The file /etc/fstab manages which partitions are automatically mounted onto the file
system. Answers b and c refer to valid items, but they are not used to manage the file system.
The file /etc/services maps networking services to the ports they utilize, and /etc/smb.conf is
the configuration file for the Samba service. Answers d and e point to files that do not exist.
33. When formating your partition with the mkfs command, you must also pass to the command the type
of filesystem and the number of __________?
Ans: blocks
When formating your partition using the mkfs utility, you must specify what filesystem type to
apply and the number of blocks contained in the partition.
34. What command should you use to check the number of files and disk space used and each user's
defined quotas?
Ans: Repquota
The repquota command is used to get a report on the status of the quotas you have set
including the amount of allocated space and amount of used space.
35.
What file defines the levels of messages written to system log files?
Ans: kernel.h
To determine the various levels of messages that are defined on your system, examine the kernel.h
file.
36. You locate a command in the /bin directory but do not know what it does. What command can
you use to determine its purpose?
Ans: whatis
The whatis command displays a summary line from the man page for the specified command.
37. What command must you run to update the database used by the whatis command?
Ans: makewhatis, he makewhatis command will create the whatis database if it does not exist or
update it if it does exist.
38. What account is created when you install Linux?
Ans: Root
Whenever you install Linux, only one user account is created. This is the superuser account also
known as root.
39. Mary has recently gotten married and wants to change her username from mstone to mknight.
Which of the following commands should you run to accomplish this?
Ans: usermod -l mknight mstone
The -l option used with the usermod command specifies the new login name for the specified
account.
40. All groups are defined in the /etc/group file. Each entry contains four fields in the following
order.
Ans: groupname, password, GID, member list
Each entry must contain four fields, groupname, password, GID, and memberlist. Any empty fields
must be defined by colons.
41. You have two files in two different directories with the same inode. What type of link is
involved?
Ans: hard
Hard links all have the same inode number, unlike symbolic links.
42. When you only back up one partition, this is called a ______ backup.
Ans: Partial
A partial backup is where you select only a portion of your file hierarchy or a single partition to back
up. This is not dependent upon whether or not the file has changed since the last backup.
43. How we can configure sata hard drieve during redhat 9 installation.
Ans: Have the data driver on a floppy drive. At the start of installation, when u boot from the
CD/DVD, on the prompt, write "dd". It will ask for the driver floppy later on and will load the sata
driver. Then you can configure/partition the drive using disk druid or fdisk.
44. After copying a file to a floppy disk, what should you do before removing the disk?
Ans: unmount the floppy
If you do not unmount the floppy before removing it, the files on the floppy may become corrupted.
45. You want to enter a series of commands from the command-line. What would be the quickest
way to do this?
Ans: Separate each command with a semi-colon (;) and press enter after the last command
The semi-colon may be used to tell the shell that you are entering multiple commands that should be
executed serially. If these were commands that you would frequently want to run, then a script might
be more efficient. However, to run these commands only once, enter the commands directly at the
command line.
46. What Hardware Is Supported?
A minimal Linux installation requires a machine for which a port exists, at least 2Mb of RAM, and a
single floppy drive, but to do anything even remotely useful, more RAM and disk space are needed.
47. Which file do you edit to set partitions to mount at boot time?
Ans: /etc/fstab
The file /etc/fstab manages which partitions are automatically mounted onto the file system. Answers
b and c refer to valid items, but they are not used to manage the file system. The file /etc/services
maps networking services to the ports they utilize, and /etc/smb.conf is the configuration file for the
Samba service. Answers d and e point to files that do not exist.
48. When formating your partition with the mkfs command, you must also pass to the command the
type of filesystem and the number of
Ans: blocks
When formating your partition using the mkfs utility, you must specify what filesystem type to apply
and the number of blocks contained in the partition.
49. After experimenting with vi as your command line editor, you decide that you want to have vi
your default editor every time you log in. What would be the appropriate way to do this?
Ans: Change the ~/.inputrc file
The /etc/inputrc file defines the default command line editor for the system. If you want to define a
different editor for your use, put it in the .inputrc file in your home directory.
50. You have a file called administration with the following attributes
-rw-rw-r-- 1 root admin 7202 Sep 17 9:10 administration George is a member of the admin group
and Bob is a member of the sales group. Both George and Bob need to make changes to this file.
What permissions do George and Bob have to the file?
Ans: George has read and write permissions and Bob has read permission.
Since George is a member of the admin group, he inherits the permissions of that group which are
read and write. Bob is neither the owner of the file or a member of the admin group, therefore, he
only gets read permission.
51. You telnet into several of your servers simultaneously. During the day, you sometimes get
confused as to which telnet session is connected to which server. Which of the following commands
in your .profile file would make it obvious to which server you are attached?
Ans: PS1='h: w>'
The PS1 variable is used to define how your prompt appears. The string listed here would display the
hostname and present working directory. Now, whenever you look at your prompt, you know which
server you working on.
52. How Is Linux Licensed?
Ans: Linus has placed the Linux kernel under the GNU General Public License, which basically
means that you may freely copy, change, and distribute it, but you may not impose any restrictions
on further distribution, and you must make the source code available.
This is not the same as Public Domain. See the Copyright FAQ,
ftp://rtfm.mit.edu/pub/usenet/news.answers/law/copyright, for details.
53. When you create a new partition, you need to designate its size by defining the starting and
ending
Ans: cylinders
When creating a new partition you must first specify its starting cylinder. You can then either specify
its size or the ending cylinder.
54. How does single user mode differ from other runlevels?
Ans: init does not read the /etc/inittab file
When starting Linux in single user mode, init does not read the /etc/inittab file. Rather, init runs
/bin/su and you are logged in as root.
55. drw-rw-r-- 1 root accounting 17249 Sep 7 10:08 accounting
drw-rw-r-- 1 root admin 7202 Sep 17 9:10 administration
drw-rw-r-- 1 root humres 13367 Sep 1 12:58 humres
drw-rw-r-- 1 root sales 9449 Sep 22 7:34 sales
George, who is a member of the admin group, attempts to delete a file contained in the humres
directory but is unsuccessful. What do you and George need to do to allow George to delete files in
this directory?
Ans: You need to add George to the humres group then George needs to make the humres group his
default group.
In order to delete a file, you must have the write permission to the directory containing the file. By
making George a member of the humres group, he would then have write permission to the directory
after he makes the humres group his default group.
56. Bob has created a new directory that will contain files that he and seven other users will be using
for a new project. These eight users are the only members of the kickoff group. What does Bob need
to do to give these users access to these files?
Ans: Change the group on the new directory to kickoff using the chgrp command.
If Bob changes the group associated with the new directory to the kickoff group, then each member
of the group can create and edit files in that directory.
57. In order to prevent a user from logging in, you can add a(n) ________at the beginning of the
password field.
Ans: asterick
If you add an asterick at the beginning of the password field in the /etc/passwd file, that user will not
be able to log in.
You can also use
passwd -l with the username to lock his account
58. You need to view the contents of the tarfile called MyBackup.tar. What command would you
use?
Ans: tar tf MyBackup.tar
The t switch tells tar to display the contents and the f modifier specifies which file to examine.
59. How can u create apache log files with name as date?(means every day it has to create new log
file with name as date) not by any scripts..
Ans: you would need to configure a cronjob which would rename the existing apache log to the
current date formant and create a new log file so that the current log can be written.
60. What type of local file server can you use to provide the distribution installation materials to the
new machine during a network installation?
Ans: NFS
E - You can use an NFS server to provide the distribution installation materials to the machine on
which you are performing the installation. Answers a, b, c, and d are all valid items but none of them
are file servers. Inetd is the superdaemon which controls all intermittently used network services.
The FSSTND is the Linux File System Standard. DNS provides domain name resolution, and NNTP
is the transfer protocol for usenet news.
61. What type of server is used to remotely assign IP addresses to machines during the installation
process?
Ans: FT
You can use a DHCP server to assign IP addresses to individual machines during the installation
process. Answers a, b, d, and e list legitimate Linux servers, but these servers do not provide IP
addresses. The SMB, or Samba, tool is used for file and print sharing across multi-OS networks. An
NFS server is for file sharing across Linux net-works. FTP is a file storage server that allows people
to browse and retrieve information by logging in to it, and HTTP is for the Web.
Ans: shutdown
The shutdown command will send a warning message to your users before bringing the system
down. Neither the reboot or halt command send messages before stopping the system.
68. What type would you set on a partition to make it a swap partition?
Ans: 82
The swap partition must be of type 82 in order for Linux to be able to use it as a swap partition.
69. How can u schedule a job using cron for 20 secs?
Ans: inux crontab format is not allowing to setup jobs to less then 1 minute. Use the sleep command
to do it:
*/1 * * * * /path/to/my/script
*/1 * * * * sleep 20 && /path/to/my/script
*/1 * * * * sleep 40 && /path/to/my/script
On this example cron daemon will run the job every 20 seconds
70. Where are the startup scripts defined?
Ans: /etc/inittab
The /etc/inittab defines which start up scripts to run at each runlevel.
71. The top utility can be used to change the priority of a running process? Another utility that can
also be used to change priority is ___________?
Ans: nice
Both the top and nice utilities provide the capability to change the priority of a running process.
nice can be usedd.
for already existing process , renice is used..
72. When is the most important time to restore a file from your backup?
Choose one
Ans : On a regular scheduled basis to verify that the data is available.
You should always do routine restorations in order to ensure that you will be able to use your
backups if the system crashes or a user loses a file.
73. Which tasks is not necessary when creating a new user by editing the /etc/passwd file?
Ans: There is no need to link the user's home directory to the shell command. Rather, the specified
shell must be present on your system.
74. Which file do you edit to set up a printer?
Ans: /etc/printtab
The file /etc/printab contains printer configuration information. Answers a, b, c, and e point to files
that do not exist
75. You want to know how much space is being occupied by your user's home directories. Which of
the following will provide you with this information?
Ans: du -c /home
Using the -c option with the du command will show the grand total of used space for the designated
directory.
76. While using fdisk what command would you use to see the partition table?
Ans: he p command will print out the partition table.
77. After the kernel is loaded, it calls the _________ daemon which is responsible for creating new
processes.
Ans: The init daemon is responsible for creating processes. It is called by the kernel at the end of
loading.
78. You want to copy the user's home directories to a new location. Which of the following
commands will accomplish this?
Ans: cp -rP /home/* newdir
The -r option tells the cp command to recurse the directories. The -P option retains the original
permissions.
79. What is difference between selinux and iptables??
No answer available currently. Be the first one to reply to this question by submitting your answer
from the form below.
80. Write a command to find all of the files which have been accessed within the last 30 days.
find / -type f -atime -30 > December.files
Ans: fsck
92. File System Commands :
hdparm(8) - Used to get or set the hard disk parameters.
mkdosfs(8) - Used to create a msdos filesystem.
mke2fs(8) - Create a Linux native filesystem which is called a second extended
filesystem. This creates the current version of the Linux filesystem.
mkfs(8) - Used to make a Linux filesystem on a device. The command "mkfs /dev/hdb1" will
create a Linux filesystem on the first partition of the second IDE drive.
mkswap(8) - Creates a Linux swap area on a device.
mount(8) - Used to mount a filesystem. It supports many types of filesystems.
stat(1u) - Used to print out inode information on a file. Usage: stat filename
swapoff(8) - Used to de-activate a swap partition.
swapon(8) - Used to activate a swap partition.
tune2fs(8) - Used to adjust filesystem parameters that are tunable on a Linux second extended
filesystem. The filesystem must not be mounted write when this operation is performed. Can adjust
maximum mount counts between filesystem checks, the time between filesystem checks, the amount
of reserved blocks, and other parameters.
umount(8) - Unmount a filesystem.
93. What folder have runlevel files?
Ans: /etc/inittab
/etc/rc.d/rc0 (Run Level 0) Halt
etc/rc.d/rc1
(Run Level 1)
etc/rc.d/rc2
etc/rc.d/rc3
etc/rc.d/rc4
etc/rc.d/rc5
etc/rc.d/rc6
/bin/bash
/bin/sh
/bin/tcsh
/bin/csh
/bin/ash
/bin/bsh
/bin/bash2
/bin/ksh
bin/zsh
95. How to Change the default Shell ?
Ans: chsh -s /bin/sh
96.What commond used to see the Memory?
Ans: cat /proc/meminfo
cat /proc/cpuinfoTo see information about your cpu
cat /proc/interruptsList interrupts in use
cat /proc/versionList Linux version
cat /proc/filesystemsList the types of filesystems in use
lsmodShow the kernel modules currently loaded
97. What is Other system tracking files ?
Ans: /var/log/wtmp - Binary info on users that have been logged on. The last command uses this info.
/var/run/utmp - Binary info on users currently logged on. The commands who, w, and finger use this
info.
/var/log/lastlog - Used by finger to tell when a user was last logged in
98. Usefull User and Group Commands?
/etc/passwd - Where the user's name, and other pertinent information are stored. This
includes the password unless your system is using shadow passwords.
/etc/shadow - Where the user's password is stored if you are using shadow passwords.
/etc/group - Where group names are stored.
/etc/aliases - Where the user's name is matched to a nickname for e-mail.
/etc/sudoers - A list of users with special privileges along with the commands they can
execute.
Ans: edquota(8) - Used to edit user or group quotas. This program uses the vi editor to edit
the quota.user and quota.group files. If the environment variable EDITOR is set to emacs, the
emacs editor will be used. Type "export EDITOR=emacs" to set that variable.
quota(1) - Display users' limits and current disk usage.
quotaoff(8) - Turns system quotas off.
quotaon(8) - Turn system quotas on.
quotacheck(8) - Used to check a filesystem for usage, and update the quota.user file.
repquota(8) - Lists a summary of quota information on filesystems.
ulimit - A bash builtin command for setting the processes a user can run. The command
"ulimit -n 9000" will set the limit on open files to 9000.
Ans: pkgadd--Used
to install packages
empty and the filled blocks and their respective counts, the size and location of the inode tables, the
disk block map and usage information, and the size of the block groups.
113. What is Parity bit ?
Ans: A parity bit is a bit that is added to ensure that the number of bits with the value one in a set of
bits is even or odd. Parity bits are used as the simplest form of error detecting code.
There are two variants of parity bits: even parity bit and odd parity bit. When using even parity,
the parity bit is set to 1 if the number of ones in a given set of bits (not including the parity bit) is
odd, making the entire set of bits (including the parity bit) even. When using odd parity, the parity bit
is set to 1 if the number of ones in a given set of bits (not including the parity bit) is even, keeping
the entire set of bits (including the parity bit) odd. In other words, an even parity bit will be set to "1"
if the number of 1's + 1 is even, and an odd parity bit will be set to "1" if the number of 1's +1 is odd.
Even parity is a special case of a cyclic redundancy check (CRC), where the 1-bit CRC is generated
by the polynomial x+1.
If the parity bit is present but not used, it may be referred to as mark parity (when the parity bit is
always 1) or space parity (the bit is always 0).
114. What is the Inode ?
Ans: The inode (index node) is a fundamental concept in the Linux and UNIX filesystem. Each
object in the filesystem is represented by an inode. But what are the objects? Let us try to understand
it in simple words. Each and every file under Linux (and UNIX) has following attributes:
=> File type (executable, block special etc)
=> Permissions (read, write etc)
=> Owner
=> Group
=> File Size
=> File access, change and modification time (remember UNIX or Linux never stores file creation
time, this is favorite question asked in UNIX/Linux sys admin job interview)
=> File deletion time
=> Number of links (soft/hard)
=> Extended attribute such as append only or no one can delete file including root user
(immutability)
=> Access Control List (ACLs)
All the above information stored in an inode. In short the inode identifies the file and its attributes
(as above) . Each inode is identified by a unique inode number within the file system. Inode is also
know as index number.
115. How to disable the root login in SSH
Ans: vi /etc/ssh/sshd_config
PermitRootLogin no
116. What are the services required for nfs, apache(http) and NIS?
Ans : Service NFS
Service httpd
117. What is the best way to check the status of any service?
Ans: Chckconfig service name status
118. Can we have two apache servers having diff versions?
Ans: Yes
119. What is grep
grep command searches the given file for lines containing a match to the given strings or
words. By default, grep prints the matching lines. Use grep to search for lines of text that match one
or many regular expressions, and outputs only the matching lines.
Ans:
Syntax
sudo -K | -L | -V | -h | -k | -l | -v
sudo [-HPSb] [-a auth_type] [-c class|-] [-p prompt] [-u username|#uid] {-e file [...] | -i
| -s | command}
125. What is the boot block ?
Ans: When a boot device is found (let's assume that it's a hard disk), the hardware is told to go to the
0th (first) sector (cylinder 0, head 0, sector 0), then load and execute the instructions there. This is
the master boot record, or MBR for you DOS-heads (sometimes also called the master boot block.)
This code is small enough to fit into one block but is intelligent enough to read the partition table
(located just past the master boot block) and find the active partition. Once it finds the active
partition, it begins to read and execute the instructions contained within the first block.
Ext4 has many new advantages than Ext3 which is used in earlier versions of
RHEL. Ext4 is comparatively faster and easy to manage. It supports supports
up to 100TB with the addition of Scalable Filesystem Add-one.
2. xen is removed and kernel virtualization machine (KVM) is introduced.
RHEL6 introduces the use of KVM (Kernel-based Virtual Machine) as its
hypervisor. In the earlier releases Xen hypervisor was used. The main
advantage of KVM is that a new kernel should not be installed like in Xen. It
also supports the installation of many virtual operating systems like Windows,
Linux, Solaris,etc. It is easy to manage.
3. neat command is removed.
4. portmap service is removed.
5. iscsi is introduced, which supports for SAN.
RHEL6 is released with improved and new networking features. It supports
IPv6. It uses NFSv4 (Network File Transfer) for the sharing of files in the
network rather than NFSv3. It also supports iSCSI (internet Small Computer
System Interface) partitions. The network manager in RHEL6 supports Wi-Fi
capabilities.
6. rpmbuild is available, which is used to create our own rpms.
7. File encyption is added.
8. palimpsest is available for disk management.
9. Virtual machine will run only on 64bit processors.
10. postfix service is recommended instead of sendmail service
How do you take a single line of input from the user in a shell script?
1. Write a script to convert all DOS style backslashes to UNIX style slashes in a list of files.
2. Write a regular expression (or sed script) to replace all occurrences of the letter f, followed
by any number of characters, followed by the letter a, followed by one or more numeric
characters, followed by the letter n, and replace whats found with the string UNIX.
3. Write a script to list all the differences between two directories.
4. Write a program in any language you choose, to reverse a file.
5. What are the fields of the password file?
6. What does a plus at the beginning of a line in the password file signify?
7. Using the man pages, find the correct ioctl to send console output to an arbitrary pty.
8. What is an MX record?
9. What is the prom command on a Sun that shows the SCSI devices?
10. What is the factory default SCSI target for /dev/sd0?
11. Where is that value controlled?
12. What happens to a child process that dies and has no parent process to wait for it and whats
bad about this?
13. Whats wrong with sendmail? What would you fix?
14. What command do you run to check file system consistency?
15. Whats wrong with running shutdown on a network?
16. What can be wrong with setuid scripts?
17. What value does spawn return?
18. Write a script to send mail from three other machines on the network to root at the machine
youre on. Use a here doc, but include in the mail message the name of the machine the
mail is sent from and the disk utilization statistics on each machine?
19. Why cant root just cd to someones home directory and run a program called a.out sitting
there by typing a.out, and why is this good?
20. What is the difference between UDP and TCP?
21. What is DNS?
22. What does nslookup do?
23. How do you create a swapfile?
24. How would you check the route table on a workstation/server?
25. How do you find which ypmaster you are bound to?
26. How do you fix a problem where a printer will cutoff anything over 1MB?