Just getting to know how to do stuff in bash

Hello World!!

Always start the script with a shebang : output

#! /bin/bash
echo "HELLO_WORLD"

Variables and Comments :

Anything after a # symbol : output

#! /bin/bashecho "HELLO_WORLD" # this is also a comment

Capital Case Variables and System Defined Info: output

# there are some system defined variables and are usually defined in CAPITAL CASES
# there are other that are defined by us(the user).
## system defined info
echo shell name : $BASH # write the bash path of running bash
echo shell version : $BASH_VERSION # write the bash version
echo home directory …

Database transaction: http://maxdb.sap.com/doc/7_7/81/74b30edc2142658e510080ef6917f1/ppt_img.gif

Database :

  1. Query processor
  2. Storage Engine
  3. Server
  4. FileSystem
  • Server : It is basically the executor for a given request. Requests are in form of Queries mostly, in some cases setting values of database.
  • Query-Processor : This component under stand the request and create a execution plan for Server to follow.
  • Storage Engine : This component talks to the filesystem that will eventually hold the data. It serves the calls from the server.
  • Filesystem : This holds the data of our Database.

DataBase V/S FileSystem

There are few features that Filesystem have that database can’t provide :

  1. Performance (given you manage how to use the filesystem).


Without ssh-key pair

create a docker image which runs ssh server :

ssh-server can be run using Openssh-server package

DockerFile :

FROM ubuntu:trusty
RUN apt-get update
RUN apt-get install -y openssh-server openssh-client
WORKDIR /root
USER root
ADD ./sshd_config /etc/ssh/sshd_config
ADD ./Dockerfile ./Dockerfile
RUN mkdir /var/run/sshd
RUN echo root:password | chpasswd
ENTRYPOINT /bin/bash

sshd_config :

Port 22
Protocol 2

HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key

LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

RSAAuthentication yes
PubKeyAuthentication yes
UsePAM yes

You need the IP of the container, as we are using bridge network for running the container here, you can find IP using :

Get the container name OR hashID :

docker container ls | grep…


What is SSH?

`S`ecure `SH`ell : SSH

At core its a Communication Protocol, that helps you do just anything on a remote system.

Benefits : Traffic is Encrypted.

Used mostly in terminal/commandline.

Client/Server Communication

SSH is the client program

SSHD is a server (ssh daemon)

The server must have `sshd` installed and running, for you will not be able to connect using ssh otherwise.

Authentication Methods:

ssh <user>@<host>

  1. Password
  2. public/private Key Pair
  3. Host Based

Passwords suck!!!

Host Based is not scalable!!!

Most common and used method is having a public/private key pair

Generating Keys

Enter `ssh-keygen`

~/.ssh/id_rsa (private key)

~/.ssh/id_rsa.pub…

Nipun Jindal

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store