Tuesday 26 August 2014

 

Hi in today's post I am going to show you guys how to access remote systems using SSH. I will be gearing this tutorial towards Centos. As it's my distro of choice :)

CentOS Remote Access Systems Using SSH

Secure Shell (SSH) is a cryptographic network protocol for secure data communication, remote command-line login, remote command execution, and other secure network services between two networked computers.

Left your computer (host) running the Putting application to remote access the Server using SSH 

Getting Down to Business Installing SSH

 Start the Service 

 

 

Add A Firewall Rule

Edit the iptables configuration file using editor of your choice. I am using vim 

 

Add the following line to the firewall rules

 

 This rule is to accept tcp connection on the port 22 (the default SSH port).

Below shows my firewall configuration file with the custom rule for SSH added

Restart the firewall after making changes

 

Using Netstat to check if Port 22 is opened. Here is a quick easy way to check to show you if Port 22 is open remember that by default SSH uses Port 22.

 

 

 As you can see SSH is listening on port :22 so we should be able to access our system remotely :)

 Accessing your Linux Server From Windows 

download and install putty.exe from here

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

  

Double click the putty icon

  

You will be greeted with the following enter your credientials and login congratulations you now have remote access to your computer using SSH.

 

Advanced SSH Configuration / Securing 

You can edit the SSH Configuration file by typing the following

 

To disable root logins change the entry to PermitRootlogin No

If you need root access after you have applied this change, login as a normal use and apply the su command. 

 

To change Port Number 

 Remember that if you change the Port Number you will have to update your firewall rules to reflect the changes.


For more Securing SSH Options please consult

http://wiki.centos.org/HowTos/Network/SecuringSSH