Giter Site home page Giter Site logo

ubuntu-sshd's Introduction

ubuntu-sshd

Dockerized SSH service, built on top of official Ubuntu images.

Image tags

  • rastasheep/ubuntu-sshd:12.04 (precise)
  • rastasheep/ubuntu-sshd:12.10 (quantal)
  • rastasheep/ubuntu-sshd:13.04 (raring)
  • rastasheep/ubuntu-sshd:13.10 (saucy)
  • rastasheep/ubuntu-sshd:14.04 (trusty)
  • rastasheep/ubuntu-sshd:16.04 (xenial)
  • rastasheep/ubuntu-sshd:18.04 (bionic)

Installed packages

Base:

Image specific:

Config:

  • PermitRootLogin yes
  • UsePAM no
  • exposed port 22
  • default command: /usr/sbin/sshd -D
  • root password: root

Run example

$ sudo docker run -d -P --name test_sshd rastasheep/ubuntu-sshd:14.04
$ sudo docker port test_sshd 22
  0.0.0.0:49154

$ ssh root@localhost -p 49154
# The password is `root`
root@test_sshd $

Security

If you are making the container accessible from the internet you'll probably want to secure it bit. You can do one of the following two things after launching the container:

  • Change the root password: docker exec -ti test_sshd passwd
  • Don't allow passwords at all, use keys instead:
$ docker exec test_sshd passwd -d root
$ docker cp file_on_host_with_allowed_public_keys test_sshd:/root/.ssh/authorized_keys
$ docker exec test_sshd chown root:root /root/.ssh/authorized_keys

Issues

If you run into any problems with this image, please check (and potentially file new) issues on the rastasheep/ubuntu-sshd repo, which is the source for this image.

ubuntu-sshd's People

Contributors

aklinkert avatar ngaro avatar rastasheep avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ubuntu-sshd's Issues

How to enable ssh logging

with release rastasheep/ubuntu-sshd five weeks ago (today is Jan19 2018) I am not seeing logs.

What do I need to install/enable to get logging.

=====

Update:

rsyslogd

starts logging.

ssh_exchange_identification: Connection closed by remote host

I started a container from Mac OS high sierra, And whenever I try to ssh to the container, I got this error.
ssh_exchange_identification: Connection closed by remote host
Here is the full log:

OpenSSH_7.6p1, LibreSSL 2.6.2
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to localhost port 32771.
debug1: Connection established.
debug1: identity file /Users/tien/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /Users/tien/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/tien/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/tien/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/tien/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/tien/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/tien/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/tien/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6
ssh_exchange_identification: Connection closed by remote host

Any idea why?

Docker machine: 0.16.0
Docker engine: 18.09.0
Ubuntu version: 14.04
Mac OS version: 10.13.6

creates ssh host key on build

The ssh host key is created generated in the apt/deb script. So in case of this image at build time.
Using prebuilt images (from dockerhub) therefore is a security risk.

Vulnerable

Great docker.
But it still uses libc 2.19-0ubuntu6.6, which is vulnerable. I made a fresh install but it still uses that version. Do you think it's a matter of Dockerfile?

Source

default example command does not work

I ran the following on my local machine:

$ docker run -d -P --name test_sshd rastasheep/ubuntu-sshd:14.04`

$ docker port test_sshd 22
0.0.0.0:32769

$ ssh root@localhost -p 32769
Received disconnect from 127.0.0.1 port 32769:2: Too many authentication failures for root
Disconnected from 127.0.0.1 port 32769

My system is:

Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic

Docker: Docker version 18.03.1-ce, build 9ee9f40

I tried adding the --privileged=true flag with no luck.

What is the use case for this image?

Hi all!

Thanks for using my image.
This is an old (forgotten) side project which wasnt updated in awhile, but with help of automatic builds on docker hub, it's still up to date and it seems that it is used widely (currently it was downloaded more than 100k times).

Can you share your use cases for this kind of image? I would like to invest some time in improvement and those informations would be more than useful to me, tnx.

connection refused on port 22

i built in image by using your Dockerfile then i start the container ,but when i try to ssh into the container i get this error :

$ ssh -v -v root@localhost
OpenSSH_7.6p1, OpenSSL 1.0.2l 25 May 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolving "localhost" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to localhost [::1] port 22.
debug1: connect to address ::1 port 22: Connection refused
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: connect to address 127.0.0.1 port 22: Connection refused
ssh: connect to host localhost port 22: Connection refused

ubuntu 16.04 apt-get install error

Hi there,

When using the 16.04 image I get the following error using the apt-get install command:

debconf: delaying package configuration, since apt-utils is not installed

It was already discussed here

I was able to fix it using their fix:
Replace:

RUN apt-get update

with:

RUN apt-get update && apt-get install -y --no-install-recommends apt-utils

The problem is that it shows some warnings after installing anything through apt-get but the actual installation does seem to work. Running with older ubuntu images doesn't have any of these problems.

My fix

License Declaration

Hey @rastasheep according to github's documentation

You're under no obligation to choose a license. However, without a license, the default copyright laws apply, meaning that you retain all rights to your source code and no one may reproduce, distribute, or create derivative works from your work. If you're creating an open source project, we strongly encourage you to include an open source license. The Open Source Guide provides additional guidance on choosing the correct license for your project

If you intend this to be more open source please include a license declaration in your repository.

If not please feel free to close this.

Connection to SSH from windows fails

I spin up the docker then try to connect to the ssh in windows
but always get the timeout error, basically saying that the it can not find the machine, anyone experience this problem?

I tried this one as well, they are not much different, but same problem

Image can't run successfull

building image success,but execution cmd "docker run -it --name server -P ubuntu:14.04", As result,the image have not sucessful

How to expose the port when deploying the container in a swarm cluster?

Hi,
This image works perfectly fine when I pull the container with the "docker run" command.
I have a requirement to create an Ubuntu container with ssh capabilities on swarm cluster.
I am using the below command to do that.

docker service create --publish 22:22 --name test_sshd2 rastasheep/ubuntu-sshd:14.04

But this doesn't seem to help. The container is unable to get started.

[root@rigel lib]# docker service ps test_sshd2
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
88qf2piv799q test_sshd2.1 rastasheep/ubuntu-sshd:14.04 orion-01.local Ready Preparing less than a second ago
s48v2kgbph0o _ test_sshd2.1 rastasheep/ubuntu-sshd:14.04 orion-01.local Shutdown Rejected less than a second ago "No such image: rastasheep/ubu…"
j78z4m4ut8r1 _ test_sshd2.1 rastasheep/ubuntu-sshd:14.04 rigel.serc.iisc.in Shutdown Failed 16 seconds ago "starting container failed: su…"
mmi5f86804u3 _ test_sshd2.1 rastasheep/ubuntu-sshd:14.04 rigel.serc.iisc.in Shutdown Failed 26 seconds ago "starting container failed: su…"
fywjp6rgydx8 _ test_sshd2.1 rastasheep/ubuntu-sshd:14.04 rigel.serc.iisc.in Shutdown Failed 32 seconds ago "starting container

Any idea about how to go ahead with this?

Thanks in advance!
Shreyas

not work for 12.04 precise

sudo docker run -d -p 222:22 rastasheep/ubuntu-sshd:12.04
rm -f $HOME/.ssh/known_hosts
sshpass -p root /usr/bin/ssh -t -o StrictHostKeyChecking=no -p 222 [email protected]
Connection to 127.0.0.1 closed by remote host.
Connection to 127.0.0.1 closed.

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.