Code Monkey home page Code Monkey logo

debian-ssh's Introduction

debian-ssh

Simple Debian/Ubuntu Docker images with passwordless SSH access and a regular user with sudo rights

Tags (and their corresponding official base images)

Debian

  • latest -> debian:latest
  • jessie -> debian:jessie
  • wheezy -> debian:wheezy
  • squeeze -> debian:squeeze

Ubuntu

  • ubuntu -> ubuntu:latest
  • vivid -> ubuntu:vivid
  • utopic -> ubuntu:utopic
  • trusty -> ubuntu:trusty
  • precise -> ubuntu:precise

Using

The images are built by Docker hub. Each Debian release corresponds to a tag. To run an SSH daemon in a new Debian "wheezy" container:

docker run -d -p 2222:22 -e SSH_KEY="$(cat ~/.ssh/id_rsa.pub)" krlmlr/debian-ssh:wheezy

This requires a public key in ~/.ssh/id_rsa.pub.

Two users exist in the container: root (superuser) and docker (a regular user with passwordless sudo). SSH access using your key will be allowed for both root and docker users. To connect to this container as root:

ssh -p 2222 root@localhost

To connect to this container as regular user:

ssh -p 2222 docker@localhost

Change 2222 to any local port number of your choice.

Enhancing

Each Debian release corresponds to a Git branch, the branches differ only by the FROM element in the Dockerfile.

To create the image krlmlr/debian-ssh e.g. for Debian "jessie":

git checkout jessie
make build

Use make rebuild to pull the base image and rebuild without caching.

Testing

Execute make test to create a container and fetch all environment variables via SSH. This requires an .ssh/id_rsa.pub file in your home, it will be passed to the container via the environment variable SSH_KEY and installed. The Makefile is configured to run the container with the limited docker account, this user is allowed to run sudo without requiring a password. The SSH daemon will be always run with root access. The debug-* targets can help troubleshooting any issues you might encounter.

debian-ssh's People

Contributors

fermayo avatar hopewise avatar krlmlr avatar tifayuki 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.