Showing posts with label SSH Issues. Show all posts
Showing posts with label SSH Issues. Show all posts

Friday, April 04, 2014

how to set SSH welcome message in centos

While logging in from command line rather than viewing the default message you can set your own welcome message some people also use it for showing false warnings messages to implement pseudo security.

To change SSH welcome message follow the steps below.
  • SSH server as root user
  •  vi /etc/motd
  • Make changes in the welcome message as per your requirements and save it.
  •  cd /etc/ssh
  • vi sshd_config 
  • change line PrintLastLog to ” no ”  then save and exit.
  • service ssh restart or service sshd restart
Now start a fresh SSH session and the new message will appear.

Saturday, March 15, 2014

Add correct host key in /home/user/.ssh/known_hosts to get rid of this message. Offending key in /home/user/.ssh/known_hosts:4

If you are getting the error below while trying to SSH the server or running the Rsync command from command-line follow the steps below to resolve this issue.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
06:ea:f1:f8:db:75:5c:0c:af:15:d7:99:2d:ef:08:2a.
Please contact your system administrator.
Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.
Offending key in /home/user/.ssh/known_hosts:4
RSA host key for domain.com has changed and you have requested strict checking.
Host key verification failed.
The SSH will show this message and exit restricting the user from connecting to the site or server, This problem arises when a site has changed servers and the server's RSA key which is transmitted when authenticating is different from the old server, To resolve the issue run the command below from command-line or SSH.

  • ssh-keygen -R example.com

Note example.com is the domain name or the server IP, The output of the above command will be like below.

======
root@server[~]# ssh-keygen -R ronakyadav.com
/root/.ssh/known_hosts updated.
Original contents retained as /root/.ssh/known_hosts.old
======

Sunday, September 08, 2013

How to change SSH port in centOS, Ubuntu.

Default port for SSH is 22 but if we want we can change the default port, To change the port no for SSH follow the steps below.

  • ssh server

  • vi /etc/ssh/sshd_config
search for line port portno (port 22) then change it from here to the port you want.

  • service sshd restart (Do not forget to restart sshd service)