Answer Unix QBank
Answer Unix QBank
Of Information
LINUX/UNIX QUESTION
Technology
BANK
Saket Kr.Pathak
Linux/Unix Question Bank
Application Tools
Shell
Kernel
Hardware
Networked UNIX (LPD) — a printer attached to a different UNIX system that can
be accessed over a TCP/IP network (for example, a printer attached to another
Red Hat Linux system running LPD (Line Printer Daemon) on the network).
Networked Windows (SMB) — a printer attached to a different system which is
sharing a printer over a SMB network (for example, a printer attached to a
Microsoft Windows™ machine).
Networked Novell (NCP) — a printer attached to a different system which uses
Novell's NetWare network technology.
Networked JetDirect — a printer connected directly to the network through HP
JetDirect instead of to a computer.
Q. No. 3. DNS.
Answer:
DNS is a network service that enables clients to resolve names to IP address and
vice-versa.
Allows machines to be logically grouped by domain names.
Provides email routing information.
A DNS server maintains the name to IP address mapping of the domain for which
it is the name server.
The DNS server for a domain is registered with the domain registrar and the
entry is maintained by the Internet Root-Servers (13) or Country Level Root-
Servers.
Whenever a server is queried, if doesn’t have the answer, the root servers are
contacted.
The root servers refer to the DNS server for that domain (in case the domain is a
top level domain) or the Country Root Server (in case the domain is country level
domain).
Named daemon is used
A DNS Server may be caching/master/slave server
The named.ca file has information of all Root Servers.
Configuration file:
/var/named/chroot/etc/named.conf
The File Transfer Protocol (FTP) is used as one of the most common means of
copying files between servers over the Internet.
Most web based download sites use the built in FTP capabilities of web browsers
and therefore most server oriented operating systems usually include an FTP
server application as part of the software suite.
Fedora linux ftp sever using default Very Secure FTP Daemon (VSFTPD) package
FTP relies on a pair of TCP ports to get the job done. It operates in two
connection channels
o FTP Control Channel, TCP Port 21: All commands send and the ftp server's
responses to those commands will go over the control connection.
o FTP Data Channel, TCP Port 20: This port is used for all subsequent data
transfers between the client and server.
With Fedora, Redhat, Ubunbtu and Debian You can start, stop, or restart
VSFTPD after booting by using these commands:
o [root@bigboy tmp]# /etc/init.d/vsftpd start
o [root@bigboy tmp]# /etc/init.d/vsftpd stop
o [root@bigboy tmp]# /etc/init.d/vsftpd restart
With Redhat / Fedora you can configure VSFTPD to start at boot you can use the
chkconfig command.
o [root@bigboy tmp]# chkconfig vsftpd on
Answer:
Boot Steps:
1. BIOS/BOOT Monitor (System Start-Up)
2. Stage-1 (Boot Loader/ MBR)
3. Stage-2 (LILO/GRUB)
4. Linux (Kernel)
5. User-Space (Init)
The boot process of an Ubuntu system starts with the boot loader (typically GRUB)
which loads the kernel and an initial ramdisk (initramfs). The initramfs sets up the
console, usually including a splash screen, starts the udev daemon to process device
events from the kernel, finds and mounts the root filesystem, and chains to it,
mounting some important virtual filesystems along the way.
Once the root filesystem is mounted, upstart takes over as PID 1, and begins to start
tasks specified in /etc/init/. While this will change in the future, at the moment these
tasks are essentially shims for System V init scripts and runlevels, defined in
/etc/rc*.d/. In the default configuration, upstart runs the contents of /etc/rcS.d/,
which sets up hardware and filesystems, and then runs the contents of /etc/rc2.d/,
which starts a variety of system services.
The most common format in which software packages are made available for SUSE
Linux is a package format called RPM, which originally stood for "RedHat Package
Manager". An rpm package consists of basically three parts: a header, a signature,
and the (generally compressed) archive itself . The header contains a complete file
list, a description of the package, a list of the features and libraries it provides, a list
of tools it requires (from other packages) in order to function. The basic rpm tool
needs information in the header to permit a package to be installed (or uninstalled!)
in such a way that:
Installing the package breaks none of the already installed packages (recursively,
as they may need packages of their own to be installed).
All the packages that the package requires for correct operation are also (or
already) installed along with the selected package, recursively.
A later version of the package does not (accidentally) replace an earlier version of
the package.
The basic idea behind RPM is to have an "enhanced archive" of a compiled binary
files along with the necessary configuration files that can be unpacked on the system
with "one click" in working package installation and later upgraded to a new version
or de-installed without remembering all the places where the fie went. An RPM
database of all available applications is installed on your computer (in /var/lib/rpm)
and this database is accessible by various tools including YaST. It helps to determine
exactly what is on your system, what might be new and updated, and what files each
package provides that another package might need to run properly.
An easy way to install RPMs along with associated dependencies is to use ‘YUM’
(Yellow dog Updater, Modified) or apt for RPM. Of the two products, I would
recommend using yum, as it has a smaller code base than apt for RPM, it is written
in python (similar to Red Hat's anaconda installer), and it makes upgrading to new
Red Hat releases relatively easy (apt for RPM has a dist-upgrade feature, but I have
never tried it).
Note that a file system cannot be unmounted when it is `busy' - for example, when
there are open files on it, or when some process has its working directory there, or
when a swap file on it is in use. The offending process could even be umount itself - it
opens libc, and libc in its turn may open for example locale files. A lazy unmount
avoids this problem.
Answer:
Most comparisons of the KDE and GNOME desktops focus on usability and
productivity apps. However, they often neglect what might be called the leisure apps
-- specifically, those used for image and music management. But in the modern
online culture, these leisure apps are often as important to users as any other aspect
of the desktop. For many, especially at home, they are probably more important than
a word processor or spreadsheet. In KDE, photo management is generally handled
by DigiKam, and music by Amarok. In GNOME, F-Spot is used most often for
photos, while traditionally Rhythmbox has been used for music.
The focus for the large part of this guide has been with the GNOME Desktop.
However, there is another popular graphical desktop environment out there known
as the K Desktop Environment, affectionately known as KDE. It is included with
most systems, and has a strong user-base, just like the GNOME Desktop. KDE offers
an alternative desktop computing experience in that while the applications should all
function in the same manner irrespective of the desktop environment chosen, the
look and feel of the graphical desktop are different. Desktop-specific tools and
applets may also be different from one environment to the next.
web
Obtaining Squid:
Source code (in C) from www.squid-cache.org
Binary executables
Linux (comes with RedHat and others)
FreeBSD
Windows
Pre-installed in Fedora/Enterprise Linux
Basic Settings:
Edit the /etc/squid/squid.conf file to configure squid
Configuration options:
Disk Cache size and location
Authentication
Allowed Hosts
Any other access restrictions (sites, content, size, time of access etc.) using ACL
service squid start/stop/restart
Squid.conf Configuration:
cache_dir ufs /var/spool/squid/cache 100 16 256
auth_param basic program /usr/lib/squid/ncsa_auth /etc/shadow
users proxy_auth required
http_access allow users
acl our_network src 172.28.250.0/24
http_access allow our_network
(Note: use squid –z for the first time to create the cache directory and its subdirectories)
Basic Settings:
Change the default value for ServerName www.<your-domain.com> in
httpd.conf and put the website content in /var/www/html
Additionally you can configure Name based Virtual Hosting (allow more than one
websites to run on the same server)
Virtual Hosting:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName server-name
DocumentRoot path-to-virtual-document-root
</VirtualHost>
<VirtualHost *:80>
ServerName server-name
DocumentRoot path-to-virtual-document-root
</VirtualHost>
Answer:
The MTA is the most important one of these. It is responsible for doing all the
"intelligent" work of e-mail transfer. While it does not actually perform any of the
delivery itself, it is the part which tells the other parts how to interact and what to do.
In a sense, the MTA is the glue which holds the whole process together.
To illustrate how the three parts of the email system work together, here's a very
general example. This is what happens when the user [email protected] sends
e-mail to [email protected]:
1. jsmith's MUA (pine, elm, etc) on host1.uiuc.edu passes the message to the
MTA (sendmail) on the local host.
2. The MTA (sendmail) notices that the message is addressed to a user at
host2.uiuc.edu. Since it is configured to know that it can reach host2.uiuc.edu
via SMTP, it passes the message to the SMTP MDA (the SMTP MDA is
actually builtin to sendmail, but all other MDAs are external programs).
3. The SMTP MDA connects to the MTA on host2.uiuc.edu (sendmail) and sends
it the message.
4. The MTA on host2.uiuc.edu (sendmail) notices that the message is addressed
to a user on the local host, so it passes the message to the local MDA.
5. The local MDA saves the message in user johndoe's mailbox.
The next time johndoe logs in to host2.uiuc.edu and runs his MUA, the message is
there waiting for him to read.
Simple Mail Transfer Protocol (SMTP) is used to transfer mail between Mail Servers
over Internet
Post Office Protocol (PoP) and Internet Message Access Protocol (IMAP) is used
between Client and Mail Server to retrieve mails
Daemon: sendmail
Configuration File: /etc/mail/sendmail.mc
Edit the following lines
LOCAL_DOMAIN(`localhost.localdomain')dnl
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
Run “make –C /etc/mail” command to compile sendmail.mc and generate
sendmail.cf file.
Restart sendmail and watch for errors
PoP3 & IMAP Server can be started using dovecot server (service dovecot
restart).