Tuesday, September 29, 2020

SSH - Configuration

 SSH

  • It is Secure Socket Shell. 
  • It allows you to connect securely to a remote computer by using a text-based interface.

Linux Machine

Installation
  • sudo apt install openssh-server openssh-client
if you want to connect through linux machine to linux, follow the below steps. If you going to use the third party software like puTTy in windows machine, then skip the following steps. 

Create SSH Key

    • ssh-keygen –t dsa

      • Enter where to save key = Default press Enter

      • Enter passphrase = which will be your key {press enter}


After key is generated, change to dir,
    • Cd ~/.ssh

      • Hidden directory where key is stored and keep list of safe ssh hosts.

      • It has two files

      • id-dsa = private key

      • id_dsa.pub = public key which can be distributed safely.

    • Change the permission for the given folder

      • chmod 700 $HOME/.ssh

    • chmod 600 $HOME/id_dsa*

    • Copy this file to remote device home directory

    • Relogin 

    • If you are prompted for passphrase,

      • You are successfully configured key based authorization.

Known hosts
    • When you are trying to connect to remote host for the first time, System will ask us to store the id to the known_host list. Once it is added, it will not ask from the second time.

    • All the known hosts hashed key are stored in the file ~/.ssh/known_hosts

    • Initially all the host id are stored in the hashed way. If you want the ip address to be visible to user, just edit the following

      • Change to root user

      • vi   /etc/ssh/ssh_config

      • Change the following HashKnownHosts yes to HashKnownHosts no

    • Once it is edited, ip address of the known host are visible.


Windows Machine

  • Install puTTy or any other similar software.
  • It follows the same procedure of creating the key and establishing the communication.


No comments:

Post a Comment

Minicom

 Installation sudo apt install minicom Configuration Giving permission to user for accessing the serial port chmod 666 /dev/ttyUSB0 after th...