Enable telnet in CentOS

​Install & configure service
# yum install telnet telnet-server -y
# vim /etc/xinetd.d/telnet
change to:
disable = no

Restart service
# service xinetd restart

​Allow auto-start service
# chkconfig telnet on
# chkconfig xinetd on

By default, telnet allows only standard user login.
Configure Telnet for root logins

Simply edit the file /etc/securetty and add the following to the end of the file:


This will allow up to 10 telnet sessions to the server as root.

Enjoy 🙂

Basic configuration on Fedora Server 25 x86_64



Brief Introduction

It’s not different if you are familiar with CentOS because it uses systemd. And normally, you will encourage to use systemctl for instance, “systemctl start named“command instead of just “service named start“.

Initial Setup

Set hostname:

Edit file /etc/hostname


By default, it comes with “vi”, if you want to use vim, you can install “dnf -y install vim” or if you are familiar with “yum”, you can still use “yum -y install vim”, but to do so, you need Internet connection.

Set IP configuration

Edit file /etc/sysconfig/network-scripts/ifcfg-ensxx

+ To assign statically:














+ To use DHCP: (Follow default configuration)


Install software

Example install “vim

First you need to update list, issue command “dnf -y update“, now you can start any installation like “dnf -y install vim

Note: If you use proxy, the way to configure your system to use proxy is as the following:

Edit file /etc/dnf/dnf.conf









Domain Name System (DNS) with bind

Install packages required for DNS

$dnf -y install bind bind-utils

Edit file /etc/resolv.conf

search mail.abc.kh

nameserver #yourServerAddress


Main configuration: /etc/named.conf

options {

listen-on port 53 {; };

listen-on-v6 port 53 { none; };

directory “/var/named”;

dump-file “/var/named/data/cache_dump.db”;

statistics-file “/var/named/data/named_stats.txt”;

memstatistics-file “/var/named/data/named_mem_stats.txt”;

allow-query { localhost; any; };

forwarders {;}; //your external (ISP) DNS


zone “.” IN {

type hint;

file “named.ca”;


zone “abc.kh” IN {

type master;

file “abc.kh.zone“;


zone “255.168.192.in-addr.arpa” IN{

type master;

file “255.zone“;



Configure Zone files

Location: /var/named

+ Forward zone: abc.kh.zone (filename)


abc.kh. IN SOA mail.abc.kh. root (

0 ; serial

1D ; refresh

1H ; retry

1W ; expire

3H ) ; minimum

IN NS mail.abc.kh.

mail IN A

IN MX 10 mail.abc.kh.

+ Reverse zone: 255.zone (filename)


255.168.192.in-addr.arpa. IN SOA mail.abc.kh. root (

0 ; serial

1D ; refresh

1H ; retry

1W ; expire

3H ) ; minimum

100.168.192.in-addr.arpa. IN NS mail.abc.kh.

100 IN PTR mail.abc.kh.

100 IN PTR abc.kh.


Start/reload service and test result

$systemctl start named or systemctl reload named

$nslookup mail.abc.kh (test against your records, or can test outside like nslookup google.com)



SMTP server with postfix

Install Postfix.

dnf -y install postfix

Configure SMTP Authentication to use Dovecot’s SASL function.

Edit file /etc/postfix/main.cf

# line 95: uncomment and specify hostname

myhostname = mail.abc.kh

# line 102: uncomment and specify domain name

mydomain = abc.kh

# line 118: uncomment

myorigin = $mydomain

# line 135: change

inet_interfaces = all

# line 138: change it if use only IPv4

inet_protocols = ipv4

# line 183: add

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

# line 283: uncomment and specify your local network

mynetworks =,

# line 438: uncomment (use Maildir)

home_mailbox = Maildir/

# line 593: add

smtpd_banner = $myhostname ESMTP

# add follows to the end

# limit an email size for 10M

message_size_limit = 10485760

# limit a mailbox for 1G

mailbox_size_limit = 1073741824

# SMTP-Auth settings

smtpd_sasl_type = dovecot

smtpd_sasl_path = private/auth

smtpd_sasl_auth_enable = yes

smtpd_sasl_security_options = noanonymous

smtpd_sasl_local_domain = $mydomain

smtpd_recipient_restrictions = permit_mynetworks,permit_auth_destination,permit_sasl_authenticated,reject


Start & enable postfix service

$ systemctl start postfix

$ systemctl enable postfix

POP/IMAP Server with dovecot

Install dovecot

dnf -y install dovecot

Configure dovecot to provide SASL function to Postfix.

Edit file /etc/dovecot/dovecot.conf

# line 24: uncomment

protocols = imap pop3 lmtp

# line 30: uncomment and change ( if not use IPv6 )

listen = *, ::

Edit file /etc/dovecot/conf.d/10-auth.conf

# line 10: uncomment and change ( allow plain text auth )

disable_plaintext_auth = no

# line 100: add

auth_mechanisms = plain login

Edit file /etc/dovecot/conf.d/10-mail.conf

# line 30: uncomment and add

mail_location = maildir:~/Maildir

Edit file /etc/dovecot/conf.d/10-master.conf

# line 96-98: uncomment and add like follows

# Postfix smtp-auth

unix_listener /var/spool/postfix/private/auth {

mode = 0666

user = postfix

group = postfix


Edit file /etc/dovecot/conf.d/10-ssl.conf

# line 8: change (not require SSL)

ssl = no


Start and enable service

$ systemctl start dovecot

$ systemctl enable dovecot


DONE! Make sure your DNS is properly configured & your firewall is disable. (systemctl disable firewall)


Configure email client (Outlook) to use email

On server, test create two users: user1, user2 and satya

$ useradd -m user1 && useradd -m user2

$ passwd user1

$ passwd user2


Configure email client

On client, make sure the connection is fine and your dns is working (nslookup)


More Settings… and make sure you got 2 ticks


Test send an email from user2 to user satya



Webmail with Squirrelmail

Download SquirrelMail for Fedora x86_64



Install require packages

If you download from other machine, you can copy via SCP to your server.

Try to install, you will know what required by SquirrelMail

Now, let install those packages:

$ dnf -y install httpd hunspell-en mod_php php-mbstring tmpwatch

Then let try again, it must be fine.

Some information to know:

  • SquirrelMail is installed in /usr/share/squirrelmail.
  • Config files are in /etc/squirrelmail
  • A config file for httpd is added to /etc/http/conf.d. This aliases /webmail to the SquirrelMail install directory.
  • A cron job is set up to purge the attachments directory daily in /etc/cron.daily/squirrelmail.cron.
  • Run /usr/share/squirrelmail/config/conf.pl


So let run:


Enter 1 , then follow the numbering and menu to edit as you wish as example below:

The most important part is option #2 Server Settings

Don’t forget to enter S to save, then if you’re sure you complete everything, then Q to exit

All you need to do with SquirrelMail is done.

Now let start the httpd service…


Start web server with httpd

Because we installed already, then just start service

$ systemctl start httpd && systemctl enable httpd

From client, let test access via browser

By default, SquirrelMail configured itself to use HTTPS, so for my case, I don’t want HTTPS anymore, just normal HTTP is fine.

What you need to do is to edit file /etc/httpd/conf.d/squirrelmail.conf

Line 24, change on to off

Then restart httpd service again. That’s it.

Test access webmail from client




Thanks you!!!