Breaking News
Loading...
Friday, May 3, 2013

Secure SHell (SSH) installation, uses, errors and it's solution

4:09:00 AM

1. What is Secure SHell (SSH)

  SSH is a network protocol which uses public-key cryptography. SSH is secure than rsh, telnet. Generally SSH is used to access remote machine using password authentication and to form cluster of different machines. You can also see GUI for file manager of remote system so that handling become easier (nautilus for GNOME, krusader for KDE etc.). Generally in Linux openssh provides SSH protocol. 



2. Installation

  • Many Linux OS images comes with this two required packages, openssh client and server already installed on it but there are some basic images with around 700 MB which won't contain this packages.
  • To know whether you have SSH installed or not you can use the command  " which ssh " if it is not giving any output then you will require to install it
  •  To install SSH in CentOS use " yum install openssh* " this command will install openssh-client and openssh-server for you.
  • To install SSH in Ubuntu use " sudo apt-get install ssh " and give your password and you are done.

3. Use

  • SSH client is used for acting as client that mean you can access other machine installed with SSH server.
  • SSH server is used for acting as server so that other can login to your machine.
  • SSH can be used to create cluster of different machine to run any job on cluster using passwordless SSH login.
  •  After installing SSH client you get Secure CoPy (SCP) program used to copy remote file. We will discuss this topic in detail in next article.
To login on remote machine you can use following command

ssh -X user@192.168.1.8 


In this command -X is use to  Enables X11 forwarding. By using X11 forwarding we can access GUI using file manager else you are not able to access GUI. Be aware of capital X and small x because small x stands for disable X11 forwarding which won't show you GUI.

4. errors and it's solution

  • If you want to access any machine and you are unable to access it then check the user name. User must present at server side, because ssh won't give you error if user is not present on other side.
  •  Error " WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! " " IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! "
        Cause :-  This error occurred due to change of OS at the server side or other illegal person is using your required server IP whose public key is known to you. Public key is stored in " known_hosts " file present in " /home/user/.ssh/ "  directory at first time when you login to server or remote machine.
        Solution :- If you want to access other machine which is not your require server then you can use following command

" ssh-keygen -R IP_ADDRESS_OF_SERVER "

This command will clear or delete the entry of public key for that particular IP present in known_hosts file and create new entry and old entries are stored in " known_hosts.old "

0 comments:

 
Toggle Footer