Giter Club home page Giter Club logo

chrootansible's Introduction

Setup a chroot with a SSH server running on port 220 and ready to be 'ansiblized'

Prerequisites

In order for this to work, you must have:

  • debootstrap
  • python-jinja2
  • python-yaml
  • id_rsa.pub present in your ~/.ssh

For ubuntu, you can copy/paste

 sudo apt-get install debootstrap python-jinja2 python-yaml

Usage

Execute ./launch_chroot.sh

If you don't have a chroot initialized, you will be asked to choose which distribution you want to create the chroot from. At the end of the setup, ansible will be launched and your chroot configured

What the script does

  • mount /proc /dev /sys and /dev/pts
  • launch the chroot and a ssh server
  • put your ssh public key to the root folder of the chroot so you're able to login without password
  • For the moment, you need to have an id_rsa.pub in your ~/.ssh, else it won't work
  • launch ansible
  • connect via ssh to the chroot

#### Faq If you have something like that:

 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 @    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
 Someone could be eavesdropping on you right now (man-in-the-middle attack)!
 It is also possible that a host key has just been changed.
 The fingerprint for the ECDSA key sent by the remote host is
 58:45:5b:9f:c5:33:8d:15:45:2b:81:c9:b3:28:1c:39.
 Please contact your system administrator.
 Add correct host key in /home/yourhome/.ssh/known_hosts to get rid of this message.
 Offending ECDSA key in /home/yourhome/.ssh/known_hosts:13
   remove with: ssh-keygen -f "/home/yourhome/.ssh/known_hosts" -R [127.0.0.1]:220
 ECDSA host key for [127.0.0.1]:220 has changed and you have requested strict checking.
 Host key verification failed.

it means that you probably had another system running on port 220. To get rid of this message, simply run the ssh-keygen command prompted by the message. In my case, this will be 'ssh-keygen -f "/home/yourhome/.ssh/known_hosts" -R [127.0.0.1]:220', stop your chroot and launch it again.

chrootansible's People

Contributors

ludoviclafole avatar michaelbitard avatar

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.