How to configure SSH Server/Client

To configure SSH Server to manage a server from the remote computer (Linux & Windows machine).

Step 1: Configure SSH Server

Edit the sshd_config file and made the following changes:

# vi /etc/ssh/sshd_config
# line 42: uncomment and change ( prohibit root login remotely )

PermitRootLogin no
# line 65: uncomment

PermitEmptyPasswords no
PasswordAuthentication yes

Step 2: Restart SSH Server

Now restart the sshd service.

# /etc/rc.d/init.d/sshd restart

Step 3: Configure SSH Client on Linux Machine

In order to configure SSH client on Linux Machine Install SSH Client.

# yum -y install openssh-clients

To connect with SSH Server authenticate with username and password using the following command:

# ssh user@tecdistro-server

The authenticity of host 'tecdistro-server ()' can't be established.
ECDSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:70:33:e9.
Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added 'tecdistro-server' (ECDSA) to the list of known hosts.
user@tecdistro-server's password:
[user@tecdistro ~]$

Step 4: Configure SSH Client on Windows Machine

To configure SSH client on Windows machine install third party tools like “Putty, OpenSSH, Bitvise etc”.
Enter Server IP and port(By default port is 22) and Click on “Open”.
Putty
Enter server credentials(Username and Password) to authenticate:

login as: user
user@172.31.28.154's password:
[user@tecdistro~]$

How to Change the IP address in LINUX

Method 1: Command Line

Step 1: Edit in /etc/sysconfig/network File

In order to change the IP address edit the following files:

# vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=tecdistro.com

Step 2: Modify in Interface

To change the interface edit the following file:
# vim /etc/network/interfaces
Also change the network script file:

# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
HWADDR=06:b8:60:e2:ad:3f
IPADDR=10.104.254.244
NETMASK=255.255.255.192

Step 3: Restart Network

Now restart the network:

/etc/init.d/network restart

Method 2: GUI Environment

Step 1: Execute setup Command

# setup

Select Network Configuration Tab
setup1

Step 2: Select Device Configuration

setup2

Step 3: Select ethernet

setup3

Step 4: Modify Network Configurations

setup4
Once the changes have made, Select SAVE & QUIT and press ENTER key from keyboard.