CentOS Command Line Installing Guide from Basic

After Installing CentOS, you will need to login on the screen:
login: user
password: root

For logging into root where you can change the configuration you need to write “su -”
The root password will be the one that is set at the time of the setup.
 

STEP -1
Setting Ethernet Interface Configuration:

For DHCP

[root@xomolinux network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:0E:BB:33
TYPE=Ethernet
UUID=e474a928-f297-4d28-a5be-6af5a0a86831
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=dhcp

For Static IP
DEVICE=eth0
HWADDR=00:0C:29:0E:BB:33
TYPE=Ethernet
UUID=e474a928-f297-4d28-a5be-6af5a0a86831
ONBOOT=yes
IPADDR=192.168.8.105
NETMASK=255.255.255.0
GATEWAY=192.168.8.1
DNS=8.8.4.4
NM_CONTROLLED=no
BOOTPROTO=none

To re-start the service

service network restart

 

STEP-2

Enabling Telnet
root@server ~]# yum install telnet telnet-server -y
Now the telnet has been installed in your server. Next open the telnet configuration /etc/xinetd.d/telnetand set disable = no:
[root@server ~]# vi /etc/xinetd.d/telnet
# default: on
# description: The telnet server serves telnet sessions; it uses \
# unencrypted username/password pairs for authentication.
service telnet
{
flags = REUSE
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.telnetd
log_on_failure += USERID
disable = no
}

Save and quit the file. Now restart the telnet service using the following command:

[root@server ~]# service xinetd start
Starting xinetd: [ OK ]
Make this service to start automatically on every reboot
[root@server ~]# chkconfig telnet on
[root@server ~]# chkconfig xinetd on

Allow the telnet default port 23 through your firewall and Router. To allow the telnet port through firewall, open the file /etc/sysconfig/iptables and enter the lines as shown in red color:

[root@server ~]# vi /etc/sysconfig/iptables
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p udp -m state --state NEW --dport 23 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --dport 23 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

Save and exit the file. Restart iptables service:

[root@server ~]# service iptables restart
iptables: Flushing firewall rules: [ OK ]
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Unloading modules: [ OK ]
iptables: Applying firewall rules: [ OK ]

Thats it. Now telnet server is ready to use.

Create a test user called “sk” with password “centos“:

[root@server ~]# useradd sk
[root@server ~]# passwd sk

Changing password for user sk.

New password:
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.

Check the Service Configuration
chkconfig --list

Linux |