Skip to content

Commit

Permalink
first release
Browse files Browse the repository at this point in the history
  • Loading branch information
danielguerra69 committed Nov 20, 2015
0 parents commit a4d1381
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM alpine:edge
MAINTAINER Daniel Guerra <[email protected]>

RUN apk add --update openssh

RUN ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa

RUN sed -i "s/UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config && sed -i "s/UsePAM.*/UsePAM no/g" /etc/ssh/sshd_config && sed -i "s/PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config && sed -i "s/#AuthorizedKeysFile/AuthorizedKeysFile/g" /etc/ssh/sshd_config

CMD ["/usr/sbin/sshd","-D"]
36 changes: 36 additions & 0 deletions Readme.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Alipne ssh server

### Dependencies

* [![2.0.0](https://badge.imagelayers.io/alpine.svg)](https://imagelayers.io/?images=alpine:edge 'edge') alpine:edge

### Image size

[![Latest](https://badge.imagelayers.io/danielguerra/apline-sshd.svg)](https://imagelayers.io/?images=danielguerra/alpine-sshd:latest 'latest') danielguerra/alpine-sshd

### Instructions

create a ssh volume
```bash
$ docker create -v /root/.ssh --name ssh-container danielguerra/ssh-container /bin/true
```
create your own keys
```bash
$ docker run --volumes-from ssh-container alpine:edge ssh-keygen -q
```
add your pub key to authorized_keys file
```bash
$ docker run --volumes-from ssh-container alpine:edge cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
```
create a copy in your directory (pwd)
```bash
$ docker run --volumes-from ssh-container -v $(pwd):/backup alpine:edge cp -R /root/.ssh/* /backup
```
start ssh server
```bash
docker run -d -p 9022:22 --volumes-from ssh-container --name=alpine-sshd --hostname=alpine-sshd danielguerra/alpine-sshd
```
ssh to your server
```bash
ssh -i id_rsa -p 9022 root@<dockerhost>
```

0 comments on commit a4d1381

Please sign in to comment.