Sunday 30 March 2014

Install and configure SquirrelMail

Install and conigure SquirrelMail

Installation of Squirrelmail
Install Squirrelmail with support via Apache
Download from squirrelmail.org - *.bz2
Confirm the MD5SUM
md5 squirrelmail-1.4.21.tar.bz2
tar -tjvf squirrelmail-1.4.21.tar.bz2

Step -1

#yum install php
#yum install php-imap
#rpm –ql php-imap
#rpm –ql php

Step -2

# mkdir /var/www/mail

--->>Extract Squirrelmail to: /var/www/mail

# cd /var/www/mail
#tar –xjvf /root/Desktop/squirrelmail-1.4.21.tar.bz2
#ln –s squirrelmail-1.4.21/ mail
# ls –l

Note -- Optionally, create symlink named 'mail' to point to Squirremail version

Step -3
--->> Create the Apache Virtual Host

# cd /etc/httpd/conf/httpd.conf

<VirtualHost 192.168.0.110:80>
ServerAdmin webmaster@mail.tiltec.com
ServerName mail.tiltec.com
DocumentRoot /var/www/mail
<Directory /var/www/mail>
Options FollowSymLinks
Order allow,deny
Allow from all
</Directory>
CustomLog logs/mail.tiltec.com.access.log combined
ErrorLog logs/mail.tiltec.com.error.log
</VirtualHost>

# service httpd restart
#echo $
#httpd –S

Step -4

-- >>Create directory under /var/local/
Create 'attach' and 'data' directories for SquirrelMail: /var/local/squirrelmail/{data,attach}
Update permissions so SquirrelMail may write to 'data' and 'attach' directories:
Change ownership to apache user /var/local/squirrelmail

# cd /var/local

#mkdir squirrelmail

#mkdir squirrelmail/{data.attach}
#chown –R apache:apache /var/local/squirrelmail

Step- 5

-->> Configure SquirrelMail defaults: /var/www/mail/mail/config/conf.pl
#vim /var/www/mail/mail/config/
#./conf.pl
Step-1

Press 1—agian1—type company name—abc pvt. Ltd.

Step- 2

Press 2 ---press 1—type domain name --- abc.com
Press A – press 4 – type imap server ip address
Press B – press 4 – type smtp server ip address

Step - 6

Attempt to access SquirrelMail

http://mail.tiltec.com/mail
http://mail.tiltec.com/mail/src/configtest.php

Note: If SELinux is enabled, use 'setsebool...' to allow httpd to connect to IMAP and SMTP ports. Consult: /var/log/messages

#chcon –t httpd_sys_content_t /var/local/squirrelmail/data
#chcon –t httpd_sys_content_t /var/local/squirrelmail/attach


Configure /etc/hosts file. In this scenario /etc/hosts file should look like this:
192.168.0.2 pro www.textiles.com

Friday 28 March 2014

Architecture of the Linux Operating System

Architecture of the Linux Operating System



The above diagram provides a conceptual view of the Linux architecture. Like all conceptual views, it is not a perfect match to the full complexity of Linux. The key point is to understand that the Kernel Space (shown in blue) and User Space (shown in yellow) represent two distinct addresses spaces. The Kernel Space is a hardware protected address space. The User Space communicates to the address via System Calls, and the kernel responds using the buffer address provided in the system call. The hardware communicates to the Kernel Space using hardware interrupts.

Kernel Space

The Linux kernel runs in the kernel space. In a sense, the kernel is a server that responds to hardware interrupt requests and system call requests. The Linux kernel provides the following services:
  • The kernel supports all hardware drivers. A few drivers are compiled into the kernel, but most are loanded on demand. The kernel configuration determines the drivers compiled into the kernel, and drivers available for dynamic loading.
  • The kernel manages memory allocation to all processes and buffers. During the boot process, the kernel allocates much of the available memory to buffers. As processes demand memory, the kernel releases unused buffer space. The kernel always keeps a reserve, and, if necessary, will terminate processes that hog too much memory. Killing a memory hog process is the last resort, and occurs only when swapping no longer solves the problem with available memory.
  • The kernel manages all processes via a scheduler. The scheduler, itself, is configurable. Thus, a scheduler configuration for a desktop favors streaming of data to improve the performance of music and videos. The scheduler configuration for servers, optimizes performance for server processes.
  • Using the Virtual File System (VFS) a generiic interface for all file systems, the file system drivers implement the code necessary to interface to each file system. Like device drivers, most file system drivers are loaded on demand.
  • The kernel implements all the drivers necessary to support networking.
  • File system security is part of the kernel, as are firewalls, and virus checking.
The actual workings of the kernel are far beyond the scope of this course. For those readers interested in more informaintion on how the kernel works check out the Interactive Map of the Kernel.

System Calls

As the interface between User Space and Kernel Space, system calls have both a User Space and Kernel Space implementation as shown in the following diagram:


This absolute separation of Kernel Space from User Space insures address space integrity. While some operating systems have over a thousand system calls, Linux has less than 150. Instead of more systems calls, Linux uses devices such as pseudo file systems and virtual sockets to pass information from the kernel space to the address. None of these mechanisms bypass the basic system call interface.

User Space

All user accounts, including the root user, operate in User Space. The root user just has permissions not granted to other user accounts, but it is still just a user account. The Commands layer includes all the GNU commands, including the various shells available to Linux. The Application layer includes shell scripts and other applications, including the graphical versions of the applications. Applications can directly access the C library, or use GNU commands.
The graphical environment in reality is a series of layered applications, as follows:
  • The X Window layer consists of those applications that define a graphical window.
  • As its name implies, the Window Manager layer is the application that manages the window environment. Linux actually supports different window managers.
  • Linux supports a number of different desktops (such as KDE, Gnome, XFCE, and LXDE). One of these desktops occupies the Desktop layer.
The diagram could be extended to additional layers for include virtualization. New technologies often just build on the layers below it.
Linux distributions package all the pieces to meet the needs of different users.

Tuesday 25 March 2014

Understand Linux Configuration Files

Understand Linux Configuration Files

What are system configuration files?

The kernel itself may be considered a "program." Why does the kernel need configuration files? The kernel needs to know the list of users and groups in the system, and manage file permissions (that is, determine if a file can be opened by a specific user, according to the permissions, UNIX_USERS). Note that these files are not specifically read by programs, but by a function provided by a system library, and used by the kernel. For instance, a program needing the (encrypted) password of a user should not open the /etc/passwd file. Instead, it should call the system library function getpw(). This kind of function is also known as a system call. It is up to the kernel (through the system library) to open the /etc/passwd file and after that, search for the password of the requested user.
Most of the configuration files in the Red Hat Linux system are in the /etc directory unless otherwise specified. The configuration files can be broadly classified into the following categories:

Access files



/etc/host.conf
Tells the network domain server how to look up hostnames. (Normally /etc/hosts, then name server; it can be changed through netconf.)
/etc/hosts
Contains a list of known hosts (in the local network). Can be used if the IP of the system is not dynamically generated. For simple hostname resolution (to dotted notation), /etc/hosts.conf normally tells the resolver to look here before asking the network nameserver, DNS or NIS.
/etc/hosts.allow
Man page same as hosts_access. Read by tcpd at least.
/etc/hosts.deny
Man page same as hosts_access. Read by tcpd at least.

Booting and login/logout



/etc/issue & /etc/issue.net
These files are read by mingetty (and similar programs) to display a "welcome" string to the user connecting from a terminal (issue) or through a telnet session (issue.net). They include a few lines stating the Red Hat release number, name, and Kernel ID. They are used by rc.local.
/etc/redhat-release
Includes one line stating the Red Hat release number and name. Used by rc.local.
/etc/rc.d/rc
Normally run for all run levels with level passed as argument. For example, to boot your machine in the Graphics mode (X-Server), run the following command from your command line: init 5. The runlevel 5 is starts the system in graphics mode.
/etc/rc.d/rc.local
Not official. May be called from rc, rc.sysinit, or /etc/inittab.
/etc/rc.d/rc.sysinit
Normally the first script run for all run levels.
/etc/rc.d/rc/rcX.d
Scripts run from rc (X stands for any number from 1 to 5). These directories are "run-level" specific directories. When a system starts up, it identifies the run-level to be initiated, and then it calls all the startup scripts present in the specific directory for that run-level. For example, the system usually starts up and the message "entering run-level 3" is shown after the boot messages; this means that all the init scripts in the directory /etc/rc.d/rc3.d/ will be called.

File system

The kernel provides an interface to display some of its data structures that can be useful for determining the system parameters like interrupts used, devices initialised, memory statistics, etc. This interface is provided as a separate but dummy filesystem known as the /proc filesystem. Many system utilities use the values present in this filesystemf or displaying the system statistics. For example, the file /proc/modules lists the currently loaded modules in the system. This information is read by the command lsmod, which then displays it in a human readable format. In the same way, the file mtab specified in the following table reads the /proc/mount file, which contains the currently mounted filesystems.


/etc/mtab
This changes continuously as the file /proc/mount changes. In other words, when filesystems are mounted and unmounted, the change is immediately reflected in this file.
/etc/fstab
Lists the filesystems currently "mountable" by the computer. This is important because when the computer boots, it runs the command mount -a, which takes care of mounting every file system marked with a "1" in the next-to-last column of fstab.
/etc/mtools.conf
Configuration for all the operations (mkdir, copy, format, etc.) on a DOS-type filesystem.

System administration



/etc/group
Contains the valid group names and the users included in the specified groups. A single user can be present in more than one group if he performs multiple tasks. For example, is a "user" is the administrator as well as a member of the project group "project 1", then his entry in the group file will look like: user: * : group-id : project1
/etc/nologin
If the file /etc/nologin exists, login(1) will allow access only to root. Other users will be shown the contents of this file and their logins refused.
etc/passwd
See "man passwd". Holds some user account info including passwords (when not "shadowed").
/etc/rpmrc
rpm command configuration. All the rpm command line options can be set together in this file so that all of the options apply globally when any rpm command is run on that system.
/etc/securetty
Contains the device names of tty lines (one per line, without leading /dev/) on which root is allowed to login.
/etc/usertty
/etc/shadow
Contains the encrypted password information for users' accounts and optionally the password aging information. Included fields are:
  • Login name
  • Encrypted password
  • Days since Jan 1, 1970 that password was last changed
  • Days before password may be changed
  • Days after which password must be changed
  • Days before password is to expire that user is warned
  • Days after password expires that account is disabled
  • Days since Jan 1, 1970 that account is disabled
/etc/shells
Holds the list of possible "shells" available to the system.
/etc/motd
Message Of The Day; used if an administrator wants to convey some message to all the users of a Linux server.

Networking



/etc/gated.conf
Configuration for gated. Used only by the gated daemon.
/etc/gated.version
Contains the version number of the gated daemon.
/etc/gateway
Optionally used by the routed daemon.
/etc/networks
Lists names and addresses of networks accessible from the network to which the machine is connected. Used by route command. Allows use of name for network.
/etc/protocols
Lists the currently available protocols. See the NAG (Network Administrators Guide) and man page.
C interface is getprotoent. Should never change.
/etc/resolv.conf
Tells the kernel which name server should be queried when a program asks to "resolve" an IP Address.
/etc/rpc
Contains instructions/rules for RPC, which can be used in NFS calls, remote file system mounting, etc.
/etc/exports
The file system to be exported (NFS) and permissions for it.
/etc/services
Translates network service names to port number/protocol. Read by inetd, telnet, tcpdump, and some other programs. There are C access routines.
/etc/inetd.conf
Config file for inetd. See the inetd man page. Holds an entry for each network service for which inetd must control daemons or other servicers. Note that services will be running, but comment them out in /etc/services so they will not be available even if running. Format: <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
/etc/sendmail.cf
The Mail program sendmail's configuration file. Cryptic to understand.
/etc/sysconfig/network
Indicates NETWORKING=yes or no. Read by rc.sysinit at least.
/etc/sysconfig/network-scripts/if*
Red Hat network configuration scripts.

System commands

System commands are meant exclusively to control the system, and make everything work properly. All the programs like login (performing the authentication phase of a user on the console) or bash (providing the interaction between a user and the computer) are system commands. The files associated with them are therefore particularly important. This category has the following files of interest to users and administrators.


/etc/lilo.conf
Contains the system's default boot command line parameters and also the different images to boot with. You can see this list by pressing Tab at the LILO prompt.
/etc/logrotate.conf
Maintains the log files present in the /var/log directory.
/etc/identd.conf
Identd is a server that implements the TCP/IP proposed standard IDENT user identification protocol as specified in the RFC 1413 document. identd operates by looking up specific TCP/IP connections and returning the user name of the process owning the connection. It can optionally return other information instead of a user name. See the identd man page.
/etc/ld.so.conf
Configuration for the Dynamic Linker.
/etc/inittab
This is chronologically the first configuration file in UNIX. The first program launched after a UNIX machine is switched on is init, which knows what to launch, thanks to inittab. It is read by init at run level changes, and controls the startup of the main process.
/etc/termcap
A database containing all of the possible terminal types and their capabilities.

Daemons

A daemon is a program running in non-interactive mode. Typically, daemon tasks are related to the networking area: they wait for connections, so that they can provide services through them. Many daemons are available for Linux, ranging from Web servers to ftp servers.


/etc/syslogd.conf
The configuration file for the syslogd daemon. syslogd is the daemon that takes care of logging (writing to disk) messages coming from other programs to the system. This service, in particular, is used by daemons that would not otherwise have any means of signaling the presence of possible problems or sending messages to users.

/etc/httpd.conf
The configuration file for Apache, the Web server. This file is typically not in /etc. It may be in /usr/local/httpd/conf/ or /etc/httpd/conf/, but to make sure, you need to check the particular Apache installation.
/etc/conf.modules or /etc/modules.conf
The configuration file for kerneld. Ironically, it is not the kernel "as a daemon". It is rather a daemon that takes care of loading additional kernel modules "on the fly" when needed.

User programs

In Linux (and UNIX in general), there are countless "user" programs. A most common user program config file is /etc/lynx.cfg. This is the configuration file for lynx, the well-known textual browser. Through this file you can define the proxy server, the character set to use, and so on. The following code sample shows a part of the lynx.cfg file that can be modified to change the proxy settings of the Linux system. These settings apply (by default) to all the users running lynx in their respective shells, unless a user overrides the default config file by specifying --cfg = "mylynx.cfg.
Proxy settings in /etc/lynx.cfg
.h1 proxy
.h2 HTTP_PROXY
.h2 HTTPS_PROXY
.h2 FTP_PROXY
.h2 GOPHER_PROXY
.h2 NEWS_PROXY
.h2 NNTP_PROXY
# Lynx version 2.2 and beyond supports the use of proxy servers that can act as
# firewall gateways and caching servers. They are preferable to the older
# gateway servers. Each protocol used by Lynx can be mapped separately using
# PROTOCOL_proxy environment variables (see Lynx Users Guide). If you have 
# not set them externally, you can set them at run time via this configuration file.
# They will not override external settings. The no_proxy variable can be used
# to inhibit proxying to selected regions of the Web (see below). Note that on
# VMS these proxy variables are set as process logicals rather than symbols, to
# preserve lowercasing, and will outlive the Lynx image.
#
.ex 15
http_proxy:http://proxy3.in.ibm.com:80/
ftp_proxy:http://proxy3.in.ibm.com:80/
#http_proxy:http://penguin.in.ibm.com:8080
#ftp_proxy:http://penguin.in.ibm.com:8080/

.h2 NO_PROXY
# The no_proxy variable can be a comma-separated list of strings defining
# no-proxy zones in the DNS domain name space.  If a tail substring of the
# domain-path for a host matches one of these strings, transactions with that
# node will not be proxied.
.ex
no_proxy:demiurge.in.ibm.com, demiurge

Changing configuration files

When changing a configuration file, make sure that the program using that configuration is restarted if it's not controlled by the system administrator or the kernel. A normal user doesn't usually have privileges to start or stop system programs and/or daemons.

The kernel

Changing configuration files in the kernel immediately affects the system. For example, changing the passwd file to add a user immediately enables that user. Also there are some kernel tunable parameters in the /proc/sys directory on any Linux system. The write-access to all these files is given only to the super-user; other users have only readonly access. The files in this directory are classified in the same manner as the Linux kernel source. Every file in this directory represents a kernel data structure that can be dynamically modified to change the system performance.
Note: Before changing any value in any of these files, make sure you know everything about the file to avoid irreparable damage to the system. Files in the /proc/sys/kernel/ directory
File name
Description
threads-max
The maximum number of tasks the kernel can run.
ctrl-alt-del
If 1, then pressing this key sequence cleanly reboots the system.
sysrq
If 1, then Alt-SysRq is active.
osrelease
Displays the release of the operating system.
ostype
Displays the type of the operating system.
hostname
The host name of the system.
domainname
Network domain of which the system is a part.
modprobe
Specifies whether modprobe should be automatically run at startup, and load the necessary modules.

Daemons and system programs

A daemon is a program that is always running in background, quietly carrying out its task. Common ones are in.ftpd (ftp server daemon), in.telnetd (telnet server daemon), and syslogd (system logging daemon). Some daemons, while running, keep a close watch on the configuration file and reload it automatically when it changes. But most of the daemons do not reload automatically. We need to "tell" them somehow that the configuration file has changed and that it should be reloaded. This can be achieved (on Red Hat Linux systems) by restarting the services using the service command.
For example, if we have changed the network configuration, we need to issue: service network restart.
Note: The services are most commonly the scripts present in the /etc/rc.d/init.d/* directory and are started by the init when the system is booted. So, to restart the service you can also do the following: /etc/rc.d/init.d/<script-for-the-service> start | stop | status
start, stop, and status are the values that these scripts take as input to perform the action.

User programs

A user or system program reads its configuration file every time it is launched. Remember, though, that some system programs are spawned when the computer is turned on, and their behaviour depends on what they read in the configuration files in /etc/. So, the first time a user program is started, the default configuration is read from the files present in the /etc/ directory. Later, the user can customise the programs by using rc and . (dot) files as explained in the next section.

User configuration files: . (dot) files and rc files

We have seen how programs can be easily configured. But what if someone does not like the way a program has been configured in /etc/? A "normal" user cannot simply go into /etc and change the configuration files; they are owned -- from the filesystem's point of view -- by root! This is why most user programs define two configuration files: the first one at a "system" level, located in /etc/; and the other one, "private" to the user, that can be found in his or her home directory.
For example, in my system I have installed the very useful wget utility. In /etc/ there is an /etc/wgetrc file. In my home directory, there is a file named .wgetrc, which describes my customised configuration (which will be loaded only when I, the user run the wget command). Other users may also have the .wgetrc file in their home directory (/home/other); this file will be read, of course, only when the user runs the wget command. In other words, the /etc/wgetrc file provides "default" values for wget, while the /home/xxx/.wgetrc file lists the "customisations" for a certain user. It is important to understand that this is the "general rule," and is not necessarily true for all cases. A program like pine, for instance, does not have any files in /etc/, but only the custom configuration in the users' home directory, in a file named .pinerc. Other programs may only have a default configuration file in /etc/, and may not let users "customize" them (it's the case with only a few of the config. files in the /etc dir.).
Commonly used rc and . (dot) files
Filename
Description
~/.bash_login
Look at "man bash". Treated by bash like ~/.bash_profile if that doesn't exist.
~/.bash_logout
Look at "man bash".Sourced by bash login shells at exit.
~/.bash_profile
Sourced by bash login shells after /etc/profile.
~/.bash_history
The list of commands executed previously.
~/.bashrcÂ
Look at "man bash". Sourced by bash non-login interactive shells (no other files are). Non-interactive shells source nothing unless BASH_ENV or ENV are set.
~/.emacs
Read by emacs at startup.
~/.forward
If this contains an e-mail address, then all mail to owner of ~ will be forwarded to that e-mail address.
~/.fvwmrc ~/.fvwm2rc
Config files for fvwm and fvwm2 (the basic X Window manager).
~/.hushlogin
Look at "man login". Causes a "quiet" login (no mail notice, last login info, or MOD).
~/.mail.rc
User init file for mail program.
~/.ncftp/
Directory for ncftp program; contains bookmarks, log, macros, preferences, trace. See man ncftp. The purpose of ncftp is to provide a powerful and flexible interface to the Internet standard File Transfer Protocol. It is intended to replace the stock ftp program that comes with the system.
~/.profile
Look at "man bash". Treated by bash like ~/.bash_profile if that and ~/.bash_login don't exist, and used by other Bourn-heritage shells too.
~/.pinerc
Pine configuration
~/.muttrc
Mutt configuration
~/.exrc
Configuration of vi can be controlled by this file.
Example: set ai sm ruler
Writing the above line in this file makes vi set the auto-indentation, matching brackets and displaying line number and rows-columns options.
~/.vimrc
Default "Vim" configuration file. Same as .exrc.
~/.gtkrc
GNOME Toolkit.
~/.kderc
KDE configuration.
~/.netrc
Default login names and passwords for ftp.
~/.rhosts
Used by the r-tools: rsh, rlogin, etc. Very weak security since host impersonation is easy.
  1. Must be owned by user (owner of ~/) or superuser.
  2. Lists hosts from which users may access this account.
  3. Ignored if it is a symbolic link.
~/.rpmrc
See "man rpm". Read by rpm if /etc/rpmrc is not present.
~/.signature
Message text that will be appended automatically to the mail sent from this account.
~/.twmrc
Config file for twm (The Window Manager).
~/.xinitrc
Read by X at startup (not by xinit script). Mostly starts some progs.
Example: exec /usr/sbin/startkde
If the above line is present in this file, then the KDE Window Manager is started in when the startx command is issued from this account.
~/.xmodmaprc
This file is passed to the xmodmap program, and could be named anything (~/.Xmodmap and ~/.keymap.km, for example).
~/.xserverrc
Run by xinit as the X server if it can find X to execute.
~/News/Sent-Message-IDs
Default mail history file for gnus.
~/.Xauthority
Read and written by xdm program to handle authorization. See the X, xdm, and xauth man pages.
~/.Xdefaults,
~/.Xdefaults-hostname
Read by X applications during startup on hostname. If the -hostname file can't be found, .Xdefaults is looked for.
~/.Xmodmap
Points to .xmodmaprc; Red Hat had (has) .xinitrc using this name.
~/.Xresources
Usually the name for the file passed to xrdb to load the X resources database, to avoid the need for applications to read a long .Xdefaults file. (~/.Xres has been used by some.)

~/mbox

User's old mail.

Sunday 23 March 2014

List of ports that are being used in Linux

The following tables list the most common communication ports used by services, daemons, and programs included in Red Hat Enterprise Linux. This listing can also be found in the /etc/services file.

The lists the Well Known Ports as defined by IANA and is used by Red Hat Enterprise Linux as default communication ports for various services, including FTP, SSH, and Samba.
Port # / Layer
Name
Comment
1
tcpmux
TCP port service multiplexer
5
rje
Remote Job Entry
7
echo
Echo service
9
discard
Null service for connection testing
11
systat
System Status service for listing connected ports
13
daytime
Sends date and time to requesting host
17
qotd
Sends quote of the day to connected host
18
msp
Message Send Protocol
19
chargen
Character Generation service; sends endless stream of characters
20
ftp-data
FTP data port
21
ftp
File Transfer Protocol (FTP) port; sometimes used by File Service Protocol (FSP)
22
ssh
Secure Shell (SSH) service
23
telnet
The Telnet service
25
smtp
Simple Mail Transfer Protocol (SMTP)
37
time
Time Protocol
39
rlp
Resource Location Protocol
42
nameserver
Internet Name Service
43
nicname
WHOIS directory service
49
tacacs
Terminal Access Controller Access Control System for TCP/IP based authentication and access
50
re-mail-ck
Remote Mail Checking Protocol
53
domain
domain name services (such as BIND)
63
whois++
WHOIS++, extended WHOIS services
67
bootps
Bootstrap Protocol (BOOTP) services; also used by Dynamic Host Configuration Protocol (DHCP) services
68
bootpc
Bootstrap (BOOTP) client; also used by Dynamic Host Control Protocol (DHCP) clients
69
tftp
Trivial File Transfer Protocol (TFTP)
70
gopher
Gopher Internet document search and retrieval
71
netrjs-1
Remote Job Service
72
netrjs-2
Remote Job Service
73
netrjs-3
Remote Job Service
73
netrjs-4
Remote Job Service
79
finger
Finger service for user contact information
80
http
HyperText Transfer Protocol (HTTP) for World Wide Web (WWW) services
88
kerberos
Kerberos network authentication system
95
supdup
Telnet protocol extension
101
hostname
Hostname services on SRI-NIC machines
102/tcp
iso-tsap
ISO Development Environment (ISODE) network applications
105
csnet-ns
Mailbox nameserver; also used by CSO nameserver
107
rtelnet
Remote Telnet
109
pop2
Post Office Protocol version 2
110
pop3
Post Office Protocol version 3
111
sunrpc
Remote Procedure Call (RPC) Protocol for remote command execution, used by Network Filesystem (NFS)
113
auth
Authentication and Ident protocols
115
sftp
Secure File Transfer Protocol (SFTP) services
117
uucp-path
Unix-to-Unix Copy Protocol (UUCP) Path services
119
nntp
Network News Transfer Protocol (NNTP) for the USENET discussion system
123
ntp
Network Time Protocol (NTP)
137
netbios-ns
NETBIOS Name Service used in Red Hat Enterprise Linux by Samba
138
netbios-dgm
NETBIOS Datagram Service used in Red Hat Enterprise Linux by Samba
139
netbios-ssn
NETBIOS Session Service used in Red Hat Enterprise Linux by Samba
143
imap
Internet Message Access Protocol (IMAP)
161
snmp
Simple Network Management Protocol (SNMP)
162
snmptrap
Traps for SNMP
163
cmip-man
Common Management Information Protocol (CMIP)
164
cmip-agent
Common Management Information Protocol (CMIP)
174
mailq
MAILQ email transport queue
177
xdmcp
X Display Manager Control Protocol (XDMCP)
178
nextstep
NeXTStep window server
179
bgp
Border Gateway Protocol
191
prospero
Prospero distributed filesystem services
194
irc
Internet Relay Chat (IRC)
199
smux
SNMP UNIX Multiplexer
201
at-rtmp
AppleTalk routing
202
at-nbp
AppleTalk name binding
204
at-echo
AppleTalk echo
206
at-zis
AppleTalk zone information
209
qmtp
Quick Mail Transfer Protocol (QMTP)
210
z39.50
NISO Z39.50 database
213
ipx
Internetwork Packet Exchange (IPX), a datagram protocol commonly used in Novell Netware environments
220
imap3
Internet Message Access Protocol version 3
245
link
LINK / 3-DNS iQuery service
347
fatserv
FATMEN file and tape management server
363
rsvp_tunnel
RSVP Tunnel
369
rpc2portmap
Coda file system portmapper
370
codaauth2
Coda file system authentication services
372
ulistproc
UNIX LISTSERV
389
ldap
Lightweight Directory Access Protocol (LDAP)
427
svrloc
Service Location Protocol (SLP)
434
mobileip-agent
Mobile Internet Protocol (IP) agent
435
mobilip-mn
Mobile Internet Protocol (IP) manager
443
https
Secure Hypertext Transfer Protocol (HTTP)
444
snpp
Simple Network Paging Protocol
445
microsoft-ds
Server Message Block (SMB) over TCP/IP
464
kpasswd
Kerberos password and key changing services
468
photuris
Photuris session key management protocol
487
saft
Simple Asynchronous File Transfer (SAFT) protocol
488
gss-http
Generic Security Services (GSS) for HTTP
496
pim-rp-disc
Rendezvous Point Discovery (RP-DISC) for Protocol Independent Multicast (PIM) services
500
isakmp
Internet Security Association and Key Management Protocol (ISAKMP)
535
iiop
Internet Inter-Orb Protocol (IIOP)
538
gdomap
GNUstep Distributed Objects Mapper (GDOMAP)
546
dhcpv6-client
Dynamic Host Configuration Protocol (DHCP) version 6 client
547
dhcpv6-server
Dynamic Host Configuration Protocol (DHCP) version 6 Service
554
rtsp
Real Time Stream Control Protocol (RTSP)
563
nntps
Network News Transport Protocol over Secure Sockets Layer (NNTPS)
565
whoami
whoami user ID listing
587
submission
Mail Message Submission Agent (MSA)
610
npmp-local
Network Peripheral Management Protocol (NPMP) local / Distributed Queueing System (DQS)
611
npmp-gui
Network Peripheral Management Protocol (NPMP) GUI / Distributed Queueing System (DQS)
612
hmmp-ind
HyperMedia Management Protocol (HMMP) Indication / DQS
631
ipp
Internet Printing Protocol (IPP)
636
ldaps
Lightweight Directory Access Protocol over Secure Sockets Layer (LDAPS)
674
acap
Application Configuration Access Protocol (ACAP)
694
ha-cluster
Heartbeat services for High-Availability Clusters
749
kerberos-adm
Kerberos version 5 (v5) 'kadmin' database administration
750
kerberos-iv
Kerberos version 4 (v4) services
765
webster
Network Dictionary
767
phonebook
Network Phonebook
873
rsync
rsync file transfer services
992
telnets
Telnet over Secure Sockets Layer (TelnetS)
993
imaps
Internet Message Access Protocol over Secure Sockets Layer (IMAPS)
994
ircs
Internet Relay Chat over Secure Sockets Layer (IRCS)
995
pop3s
Post Office Protocol version 3 over Secure Sockets Layer (POP3S)

The lists UNIX-specific ports and cover services ranging from email to authentication and more. Names enclosed in brackets (for example, [service]) are either daemon names for the service or common alias(es).
Port # / Layer
Name
Comment
512/tcp
exec
Authentication for remote process execution
512/udp
biff [comsat]
Asynchrous mail client (biff) and service (comsat)
513/tcp
login
Remote Login (rlogin)
513/udp
who [whod]
whod user logging daemon
514/tcp
shell [cmd]
Remote shell (rshell) and remote copy (rcp) with no logging
514/udp
syslog
UNIX system logging service
515
printer [spooler]
Line printer (lpr) spooler
517/udp
talk
Talk remote calling service and client
518/udp
ntalk
Network talk (ntalk) remote calling service and client
519
utime [unixtime]
UNIX time (utime) protocol
520/tcp
efs
Extended Filename Server (EFS)
520/udp
router [route, routed]
Routing Information Protocol (RIP)
521
ripng
Routing Information Protocol for Internet Protocol version 6 (IPv6)
525
timed [timeserver]
Time daemon (timed)
526/tcp
tempo [newdate]
Tempo
530/tcp
courier [rpc]
Courier Remote Procedure Call (RPC) protocol
531/tcp
conference [chat]
Internet Relay Chat
532
netnews
Netnews newsgroup service
533/udp
netwall
Netwall for emergency broadcasts
540/tcp
uucp [uucpd]
UNIX-to-UNIX copy services
543/tcp
klogin
Kerberos version 5 (v5) remote login
544/tcp
kshell
Kerberos version 5 (v5) remote shell
548
afpovertcp
Appletalk Filing Protocol (AFP) over Transmission Control Protocol (TCP)
556
remotefs [rfs_server, rfs]
Brunhoff's Remote Filesystem (RFS)

The lists ports submitted by the network and software community to the IANA for formal registration into the port number list.
Port # / Layer
Name
Comment
1080
socks
SOCKS network application proxy services
1236
bvcontrol [rmtcfg]
Remote configuration server for Gracilis Packeten network switches[a]
1300
h323hostcallsc
H.323 telecommunication Host Call Secure
1433
ms-sql-s
Microsoft SQL Server
1434
ms-sql-m
Microsoft SQL Monitor
1494
ica
Citrix ICA Client
1512
wins
Microsoft Windows Internet Name Server
1524
ingreslock
Ingres Database Management System (DBMS) lock services
1525
prospero-np
Prospero non-privileged
1645
datametrics [old-radius]
Datametrics / old radius entry
1646
sa-msg-port [oldradacct]
sa-msg-port / old radacct entry
1649
kermit
Kermit file transfer and management service
1701
l2tp [l2f]
Layer 2 Tunneling Protocol (LT2P) / Layer 2 Forwarding (L2F)
1718
h323gatedisc
H.323 telecommunication Gatekeeper Discovery
1719
h323gatestat
H.323 telecommunication Gatekeeper Status
1720
h323hostcall
H.323 telecommunication Host Call setup
1758
tftp-mcast
Trivial FTP Multicast
1759/udp
mtftp
Multicast Trivial FTP (MTFTP)
1789
hello
Hello router communication protocol
1812
radius
Radius dial-up authentication and accounting services
1813
radius-acct
Radius Accounting
1911
mtp
Starlight Networks Multimedia Transport Protocol (MTP)
1985
hsrp
Cisco Hot Standby Router Protocol
1986
licensedaemon
Cisco License Management Daemon
1997
gdp-port
Cisco Gateway Discovery Protocol (GDP)
2049
nfs [nfsd]
Network File System (NFS)
2102
zephyr-srv
Zephyr distributed messaging Server
2103
zephyr-clt
Zephyr client
2104
zephyr-hm
Zephyr host manager
2401
cvspserver
Concurrent Versions System (CVS) client/server operations
2430/tcp
venus
Venus cache manager for Coda file system (codacon port)
2430/udp
venus
Venus cache manager for Coda file system (callback/wbc interface)
2431/tcp
venus-se
Venus Transmission Control Protocol (TCP) side effects
2431/udp
venus-se
Venus User Datagram Protocol (UDP) side effects
2432/udp
codasrv
Coda file system server port
2433/tcp
codasrv-se
Coda file system TCP side effects
2433/udp
codasrv-se
Coda file system UDP SFTP side effect
2600
hpstgmgr [zebrasrv]
Zebra routing[b]
2601
discp-client [zebra]
discp client; Zebra integrated shell
2602
discp-server [ripd]
discp server; Routing Information Protocol daemon (ripd)
2603
servicemeter [ripngd]
Service Meter; RIP daemon for IPv6
2604
nsc-ccs [ospfd]
NSC CCS; Open Shortest Path First daemon (ospfd)
2605
nsc-posa
NSC POSA; Border Gateway Protocol daemon (bgpd)
2606
netmon [ospf6d]
Dell Netmon; OSPF for IPv6 daemon (ospf6d)
2809
corbaloc
Common Object Request Broker Architecture (CORBA) naming service locator
3130
icpv2
Internet Cache Protocol version 2 (v2); used by Squid proxy caching server
3306
mysql
MySQL database service
3346
trnsprntproxy
Transparent proxy
4011
pxe
Pre-execution Environment (PXE) service
4321
rwhois
Remote Whois (rwhois) service
4444
krb524
Kerberos version 5 (v5) to version 4 (v4) ticket translator
5002
rfe
Radio Free Ethernet (RFE) audio broadcasting system
5308
cfengine
Configuration engine (Cfengine)
5999
cvsup [CVSup]
CVSup file transfer and update tool
6000/tcp
x11 [X]
X Window System services
7000
afs3-fileserver
Andrew File System (AFS) file server
7001
afs3-callback
AFS port for callbacks to cache manager
7002
afs3-prserver
AFS user and group database
7003
afs3-vlserver
AFS volume location database
7004
afs3-kaserver
AFS Kerberos authentication service
7005
afs3-volser
AFS volume management server
7006
afs3-errors
AFS error interpretation service
7007
afs3-bos
AFS basic overseer process
7008
afs3-update
AFS server-to-server updater
7009
afs3-rmtsys
AFS remote cache manager service
9876
sd
Session Director for IP multicast conferencing
10080
amanda
Advanced Maryland Automatic Network Disk Archiver (Amanda) backup services
11371
pgpkeyserver
Pretty Good Privacy (PGP) / GNU Privacy Guard (GPG) public keyserver
11720
h323callsigalt
H.323 Call Signal Alternate
13720
bprd
Veritas NetBackup Request Daemon (bprd)
13721
bpdbm
Veritas NetBackup Database Manager (bpdbm)
13722
bpjava-msvc
Veritas NetBackup Java / Microsoft Visual C++ (MSVC) protocol
13724
vnetd
Veritas network utility
13782
bpcd
Veritas NetBackup
13783
vopied
Veritas VOPIE authentication daemon
22273
wnn6 [wnn4]
Kana/Kanji conversion system[c]
26000
quake
Quake (and related) multi-player game servers
26208
wnn6-ds
Wnn6 Kana/Kanji server
33434
traceroute
Traceroute network tracking tool
Notes:
a. Comment from /etc/services: "Port 1236 is registered as `bvcontrol', but is also used by the Gracilis Packeten remote config server. The official name is listed as the primary name, with the unregistered name as an alias."
b. Comment from /etc/services: "Ports numbered 2600 through 2606 are used by the zebra package without being registered. The primary names are the registered names, and the unregistered names used by zebra are listed as aliases."
c. Comment from /etc/services: "This port is registered as wnn6, but also used under the unregistered name 'wnn4' by the FreeWnn package."

Here is a listing of ports related to the Datagram Delivery Protocol (DDP) used on AppleTalk networks.
Port # / Layer
Name
Comment
1/ddp
rtmp
Routing Table Management Protocol
2/ddp
nbp
Name Binding Protocol
4/ddp
echo
AppleTalk Echo Protocol
6/ddp
zip
Zone Information Protocol

Here is a listing of ports related to the Kerberos network authentication protocol. Where noted, v5 refers to the Kerberos version 5 protocol. Note that these ports are not registered with the IANA.
Port # / Layer
Name
Comment
751
kerberos_master
Kerberos authentication
752
passwd_server
Kerberos Password (kpasswd) server
754
krb5_prop
Kerberos v5 slave propagation
760
krbupdate [kreg]
Kerberos registration
1109
kpop
Kerberos Post Office Protocol (KPOP)
2053
knetd
Kerberos de-multiplexor
2105
eklogin
Kerberos v5 encrypted remote login (rlogin)

Here is a listing of unregistered ports that are used by services and protocols that may be installed on your Red Hat Enterprise Linux system, or that is necessary for communication between Red Hat Enterprise Linux and other operating systems.
Port # / Layer
Name
Comment
15/tcp
netstat
Network Status (netstat)
98/tcp
linuxconf
Linuxconf Linux administration tool
106
poppassd
Post Office Protocol password change daemon (POPPASSD)
465/tcp
smtps
Simple Mail Transfer Protocol over Secure Sockets Layer (SMTPS)
616/tcp
gii
Gated (routing daemon) Interactive Interface
808
omirr [omirrd]
Online Mirror (Omirr) file mirroring services
871/tcp
supfileserv
Software Upgrade Protocol (SUP) server
901/tcp
swat
Samba Web Administration Tool (SWAT)
953
rndc
Berkeley Internet Name Domain version 9 (BIND 9) remote configuration tool
1127/tcp
supfiledbg
Software Upgrade Protocol (SUP) debugging
1178/tcp
skkserv
Simple Kana to Kanji (SKK) Japanese input server
1313/tcp
xtel
French Minitel text information system
1529/tcp
support [prmsd, gnatsd]
GNATS bug tracking system
2003/tcp
cfinger
GNU finger
2150
ninstall
Network Installation Service
2988
afbackup
afbackup client-server backup system
3128/tcp
squid
Squid Web proxy cache
3455
prsvp
RSVP port
5432
postgres
PostgreSQL database
4557/tcp
fax
FAX transmission service (old service)
4559/tcp
hylafax
HylaFAX client-server protocol (new service)
5232
sgi-dgl
SGI Distributed Graphics Library
5354
noclog
NOCOL network operation center logging daemon (noclogd)
5355
hostmon
NOCOL network operation center host monitoring
5680/tcp
canna
Canna Japanese character input interface
6010/tcp
x11-ssh-offset
Secure Shell (SSH) X11 forwarding offset
6667
ircd
Internet Relay Chat daemon (ircd)
7100/tcp
xfs
X Font Server (XFS)
7666/tcp
tircproxy
Tircproxy IRC proxy service
8008
http-alt
Hypertext Tranfer Protocol (HTTP) alternate
8080
webcache
World Wide Web (WWW) caching service
8081
tproxy
Transparent Proxy
9100/tcp
jetdirect [laserjet, hplj]
Hewlett-Packard (HP) JetDirect network printing service
9359
mandelspawn [mandelbrot]
Parallel mandelbrot spawning program for the X Window System
10081
kamanda
Amanda backup service over Kerberos
10082/tcp
amandaidx
Amanda index server
10083/tcp
amidxtape
Amanda tape server
20011
isdnlog
Integrated Services Digital Network (ISDN) logging system
20012
vboxd
ISDN voice box daemon (vboxd)
22305/tcp
wnn4_Kr
kWnn Korean input system
22289/tcp
wnn4_Cn
cWnn Chinese input system
22321/tcp
wnn4_Tw
tWnn Chinese input system (Taiwan)
24554
binkp
Binkley TCP/IP Fidonet mailer daemon
27374
asp
Address Search Protocol
60177
tfido
Ifmail FidoNet compatible mailer service
60179
fido
FidoNet electronic mail and news network