Giter Site home page Giter Site logo

centos_sshd's Introduction

centos_sshd

SShd service enabled centos' docker image
Docker Hub Repo -: https://hub.docker.com/repository/docker/tigllon/centos_sshd

What's Unique About This Image

Well , the uniqueness of this image is that it supports-only the key-based authentication which is very much good in context of security . Also, the way it takes the public key to store it in authorized_keys file (present inside /root/.ssh/ directory ) makes very much easy to make the use of it in the automation world tools like Ansible.

How To Use It

Well , it is pretty much easy and the same the way to deploy any container.Typically , we use docker [some options according to our custom need] [container name] image. We will make the use of same command but with one more extra option i.e -e (yup , you got right the --env option).. So ,it looks something like this

docker run -dit --name [name of conatiner you want to give] -e public_key=[your public key] [name of image] 

So,one of the way of providing the public key to public_key env option is

docker run -dit --name [name of conatainer] -e public_key="`cat (path to public key file)`" [image name]

Notice , the public_key option over there this is the only extra thing we have to do . The starting_script.sh will take public_key of the client from the $public_key shell environment variable and update it in /root/.ssh/authorized_keys file , and then we will be able to do ssh into it...

So , Finally How it makes easy to use with the tools like Ansible ??

Well, as you seen above it takes the public key from the environment variable name $public_key , so if you know about Ansible there we have the module name docker for deploying containers and in that module we have option env in which we can pass the public_key of the client . But , if we have the image that contains the password then we can not make the use of it in automation . We have to manually , do the ssh over there..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.