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 Name


Packages
Required


Service To Be
Started


Port(s) To Be Opened via Firewall


Main Configuration
File(s)


Config Check
Command
(if any)


SSH (Secure Shell)

openssh-server
{ openssh,
pam }


sshd
(service sshd start)




22(tcp)


/etc/ssh/sshd_conf



sshd -t

VsFTP (Very Secure FTP

vsftpd
{ logrotate }

vsftpd
(service vsftpd start)



21(tcp)


/etc/vsftpd/vsftpd.conf



vsftpd




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/exports



Any 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)




dhcp



dhcpd
(service dhcpd start )




68(tcp)



/etc/dhcp/dhcpd.conf




service dhcpd configtest




Apache (httpd)




httpd, mod_ssl




httpd
( service httpd start )




80(tcp) &
443 (tcp-ssl)




/etc/httpd/conf/httpd.conf

httpd -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.conf





testparm



Mail Server - Postfix


postfix
{ openssl
mysql-libs
pcre }


postfix
(service postfix start)



25 (tcp)



/etc/postfix/main.cf




postfix check



Mail Server - Sendmail


sendmail
{ procmail
core-utils
initscripts }



sendmail
(service sendmail start)




25 (tcp)




/etc/mail/sendmail.cf


This 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.conf




Errors in config file would normally show up on service start.



NTP (Network Time Protocol)




ntp

  

ntpd
( service ntpd start)




123(udp)




/etc/ntp.conf


There 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)



cups


    cups
(service cups start)




631/(tcp/udp)



/etc/cups/cups.conf


Need 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: