How to Update SSH & MOTD Banner on CentOS 6

For legal reasons, Some people need to display a warning banner on their Linux machine before login so that a person requires to acknowledge the contents of the banner before entering the password. To do this, edit a/etc/issue.net file and fill it with the desired context.

Edit the  /etc/issue.net file:

sudo nano /etc/issue.net

001Here is mine banner as a sample, you can add your’s here:

#########################################################
# Authorized access only! # 
# Disconnect IMMEDIATELY if you are not an authorized user!!! #
# All actions Will be monitored and recorded #
###############################################################

Continue reading “How to Update SSH & MOTD Banner on CentOS 6” »

Share

Reinstall OpenSSH Server

First if you have any pre-installed SSH server that has gone bad, remove it-

on Redhat Architechture

Type the following commands as the root user:

# chkconfig sshd off
# service sshd stop
# yum erase openssh-server

You need to edit and update firewall rules that allows inbound connections to SSHs tcp port # 22. Edit /etc/sysconfig/iptables and /etc/sysconfig/ip6tables. In each file find and delete the line that access connection to port # 22. A sample entry: Continue reading “Reinstall OpenSSH Server” »

Share

SSH Public key based authentication

Method-1:

Create the cryptographic Key on FreeBSD / Linux / UNIX workstation, enter:

ssh-keygen -t rsa
Assign the pass phrase (press [enter] key twice if you don’t want a passphrase). It will create 2 files in ~/.ssh directory as follows:
  • ~/.ssh/id_rsa : identification (private) key
  • ~/.ssh/id_rsa.pub : public key
Use scp to copy the id_rsa.pub (public key) to rh9linux.nixcraft.org server as authorized_keys2 file, this is know as Installing the public key to server.
 
scp .ssh/id_rsa.pub vivek@rh9linux.nixcraft.org:.ssh/authorized_keys2
 
From FreeBSD workstation login to server: Continue reading “SSH Public key based authentication” »
Share