Friday, October 6, 2017

Simply Services Cheat Sheet

This is a simple table which would list out commonly used services with a quick look. I’ve tried to sum-up service configuration at the basic level, so, this table would provide a quick look on packages required to start service, config files to be used, ports to be opened via firewall, command to check for syntax errors(if any) and commands to bring up service. This is not an exclusive information regarding configuring a service in Linux, but just a quick look sheet. Also note that I've tried to list out most commonly used services.

Simple Service Configuration Table
Service NamePackages
Required
Service To Be
Started
Port(s) To Be Opened via FirewallMain Configuration
File(s)
Config Check Command
(if any)
SSH (Secure Shell)openssh-server
{ openssh,
pam }
sshd
(service sshd start)
22(tcp)/etc/ssh/sshd_confsshd -t
VsFTP (Very Secure FTPvsftpd
{ logrotate }
vsftpd
(service vsftpd start)
21(tcp)/etc/vsftpd/vsftpd.confvsftpd
NFS
(Network File System)
nfs4-acl-tools &
nfs-utils
rpcbind
(service rpdbind start )


nfs
(service nfs start)

nfslock
(service nfslock start)
2049(tcp) &
111(tcp)
/etc/exportsAny errors in /etc/exports file would be reported in /var/log/messages and also during service startup.
DNS (Domain Name System)bind, bind-utils
& bind-libs
named
(service named start )
53 (tcp
& udp)
/etc/named.conf
/etc/resolv.conf
Zone files:(example)
/var/named/example.com.zone
/var/named/example.com.revzone
service named configtest
DHCP
(Dynamic Host Configuration Protocol)
dhcpdhcpd
(service dhcpd start )
68(tcp)/etc/dhcp/dhcpd.confservice dhcpd configtest
Apache (httpd)httpd, mod_sslhttpd
( service httpd start )
80(tcp) &
443 (tcp-ssl)
/etc/httpd/conf/httpd.confhttpd -t

OR
apachectl configtest

OR
apachectl -t
SMB (Server Message Block)samba,
samba-client,
samba-common
smb
(service smbd start )

nmb
(service nmbd start )
137 & 138 (udp)
139 & 445 (tcp)
/etc/samba/smb.conftestparm
Mail Server - Postfixpostfix
{ openssl
mysql-libs
pcre }
postfix
(service postfix start)
25 (tcp)/etc/postfix/main.cfpostfix check
Mail Server - Sendmailsendmail
{ procmail
core-utils
initscripts }
sendmail
(service sendmail start)
25 (tcp)/etc/mail/sendmail.cfThis could be checked in /var/log/maillog file. Otherwise, when starting the service it would display if any errors.
Proxy Server-
Squid
squid
{ libtool-ltdl }
squid
(service squid start )
3128(tcp)
( default port could be changed )
/etc/squid/squid.confErrors in config file would normally show up on service start.
NTP (Network Time Protocol)ntpntpd
( service ntpd start)
123(udp)/etc/ntp.confThere is no specific option to check this, however, one could grep for "syntax error" in /var/log/messages file.
rsyslogd (Logging Daemon)rsyslog
{ logrotate}
rsyslog
(service rsyslog start)
514(tcp/
udp)
(for remote logging )
/etc/rsyslog.conf
/etc/sysconfig/rsyslog
Usually such errors would get logged in /var/log/message file and can be searched using key word { grep "CONFIG ERROR" /var/log/messages }
cups
(Common UNIX Printing System)
cupscups
(service cups start)
631/(tcp/udp)/etc/cups/cups.confNeed to check logs under /var/log/cups/ (unless changed)

  • For Red Hat variant systems.
  • In RHEL7.x, need to use “systemctl start <servicename>” to start respective service.
  • Respective ports needs to open in firewall unless it is turned off.
  • These config files may change in other Linux variants such as Ubuntu, Debian etc.,
  • Only main config files are listed out, there may be additional config files that needs to be configured based on needs.
  • *under ‘packages required’ I’ve listed dependent package within curly braces.
  • These configurations works perfect in RHEL6.x environment and it may slightly change in advanced versions.

No comments: