Problem

              “REMOTE HOST IDENTIFICATION HAS CHANGED”

 

[root@test ~]# ssh 10.10.10.110

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!

Someone could be eavesdropping on you right now (man-in-the-middle attack)!

It is also possible that a host key has just been changed.

The fingerprint for the ECDSA key sent by the remote host is

SHA256:Z8a5Z9sRzx38HRONwy/jrxt4GeeB8Bb6pGJNTH629bQ.

Please contact your system administrator.

Add correct host key in /root/.ssh/known_hosts to get rid of this message.

Offending ECDSA key in /root/.ssh/known_hosts:1

ECDSA host key for 10.10.10.11 has changed and you have requested strict checking.

Host key verification failed.

#cat /root/.ssh/known_hosts| grep 10.10.10.11

10.10.10.11 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCsg9c8VsnZceixYiJ8pq

Reason SSH authentication key is changed in the destination server

Fix for this issue remove or comment older authentication key from source server in /root/.ssh/known_hosts file and try ssh it will work.


[root@test]# ssh 10.10.10.11
ssh_exchange_identification: Connection closed by remote host
Reason for this issue
  •    SSH connection is very slow b/w two clients so not able to exchange the ssh keys #time ssh user@ IP — >figure out why slow
  •    /etc/hosts.deny file may be ssh is added – – > remove the entry
  •    SSH key got corrupted – – > remove the key and exchange new one

  • PXE boot file example

[root@test pxelinux.cfg]# cat test143

default esxi-6
label esxi-6
KERNEL vse/vmware/esxi-hp-600u2/mboot.c32
APPEND -c vse/vmware/esxi-hp-600u2/boot.cfg pxebooting ks=https://xx.xx.xx.xx/builds/hosts/test/test143/ks.cfg noverifyssl ip=xx.xx.xx.xx netmask=xx.xx.xx.xx gateway=xx.xx.xx.xx

 

  • Check PXE boot file below line is correct or wrong in the Linux or vmware server. Modify the correct one and re-try

KERNEL vse/vmware/esxi-hp-600u2/mboot.c32


Log rotate Configuration File.

# cat /etc/logrotate.conf
# see “man logrotate” for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# use date as a suffix of the rotated file
dateext

# uncomment this if you want your log files compressed
#compress

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp and btmp — we’ll rotate them here
/var/log/wtmp {
monthly
create 0664 root utmp
minsize 1M
rotate 1
}

/var/log/btmp {
missingok
monthly
create 0600 root utmp
rotate 1
}

# system-specific logs may be also be configured here.

 

Daily CRON Job logrotate added

# cat /etc/cron.daily/logrotate
#!/bin/sh
/usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate “ALERT exited abnormally with [$EXITVALUE]”
fi
exit 0

 

Know the status cat /var/lib/logrotate/logrotate.status

Command to rotate logs manually try below commands

logrotate -f /etc/logrotate.conf
logrotate -vf /etc/logrotate.conf
logrotate -d /etc/logrotate.conf


Note

          below testing Server load commands and script only for testing not recommended for Live production server & dont executed in Physical server Hardware may fail try in VMware and Cloud servers.

 

Download rpm – https://rpmfind.net/linux/rpm2html/search.php?query=stress

Install stress rpm – rpm -ivh stress-xxx-.rpm

 

Stress.sh

#!/bin/bash
m=M
MEM=$(free -m | grep ‘Mem:’ | awk ‘{print $7}’)
fmem=$(echo “$MEM*0.95” | bc)
fmem=$( printf “%.0f” $fmem )
CPU=$(grep -c ^processor /proc/cpuinfo)
FCPU=$((CPU-1))
stress –cpu $FCPU -m 1 –vm-bytes $fmem$m –timeout 300

 

Monitor Load using below script

#cat Monitor_load.sh
#!/bin/bash
MEMORY=$(free -m | awk ‘NR==2{printf “%.2f%%\t\t\n”, $3*100/$2 }’)
CPU=$(top -d 0.5 -b -n2 | grep “Cpu(s)”|tail -n 1 | awk ‘{print $2 + $4+ $6}’)
echo “Memory Usage = ${MEMORY}”
echo “CPU Usage = ${CPU}”

 

useful commands during High Server Load testing

top

uptime
free -m
sar -r
sar 5 5


Possibilities of Gateway is not pining issue

  1. Check Physical connection BW server and switch
  2. Check VLAN id is correct BW server and switch
  3. Check default Firewall rules are disabled or not
  4. Check HW Address && UUID of eth0 interface is correct?
  5. Use correct netmask parameter & netmask IP address should be same.

PREFIX=20
NETMASK=255.255.240.0


# RHEL 5
# ------------------------------------------------------------------------------------------

# To force users to enter password in Single User mode, add following line to /etc/inittab:

~:S:respawn:/sbin/sulogin

# The changes to this file takes effect after a system reboot

# To make init re-read the /etc/inittab without rebooting the system, type the command

/sbin/init q



# RHEL 6
# ------------------------------------------------------------------------------------------

# Edit /etc/inittab and add "su:S:wait:/sbin/sulogin" before 'initdefault' line:

vi /etc/inittab
   [...]
   su:S:wait:/sbin/sulogin
   id:3:initdefault:

# Edit /etc/sysconfig/init and replace "SINGLE=/sbin/sushell"  with "SINGLE=/sbin/sulogin":

vi /etc/sysconfig/init
   [...]
   # Set to '/sbin/sulogin' to prompt for password on single-user mode
   # Set to '/sbin/sushell' otherwise
   SINGLE=/sbin/sulogin



# RHEL 7
# ------------------------------------------------------------------------------------------

# By default, Single User mode is password protected by the root password on RHEL 7:

cat /usr/lib/systemd/system/rescue.service
   [...]

   [Service]
   Environment=HOME=/root
   WorkingDirectory=/root
   ExecStartPre=-/bin/plymouth quit
   ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type [...]
   ExecStart=-/bin/sh -c "/usr/sbin/sulogin; /usr/bin/systemctl --fail --no-block default" <---
   Type=idle
   StandardInput=tty-force
   StandardOutput=inherit
   StandardError=inherit
   KillMode=process
   IgnoreSIGPIPE=no
   SendSIGHUP=yes