Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Commit

Permalink
Updated to OpenSSH 7.9 / Alpine Linux 3.9.4.
Browse files Browse the repository at this point in the history
  • Loading branch information
trashpanda001 committed May 18, 2019
1 parent 9475656 commit 22fe8db
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
18 changes: 10 additions & 8 deletions README.md
Expand Up @@ -6,7 +6,8 @@ The root password is "root". SSH host keys (RSA, DSA, ECDSA, and ED25519) are au

#### OpenSSL Version Tags

- `7.5-r2`, `latest` (OpenSSH_7.5p1-hpn14v4, LibreSSL 2.6.3, [Dockerfile](https://github.com/sickp/docker-alpine-sshd/tree/master/versions/7.5-r2/Dockerfile))
- `7.9-r1`, `7.9`, `latest` (OpenSSH_7.9, OpenSSL 1.1.1b, [Dockerfile](https://github.com/sickp/docker-alpine-sshd/tree/master/versions/7.9-r1/Dockerfile))
- `7.5-r2` (OpenSSH_7.5p1-hpn14v4, LibreSSL 2.6.3, [Dockerfile](https://github.com/sickp/docker-alpine-sshd/tree/master/versions/7.5-r2/Dockerfile))
- `7.5` (OpenSSH_7.5p1-hpn14v4, LibreSSL 2.5.4, [Dockerfile](https://github.com/sickp/docker-alpine-sshd/tree/master/versions/7.5/Dockerfile))
- `7.4` (OpenSSH_7.4p1, LibreSSL 2.4.4, [Dockerfile](https://github.com/sickp/docker-alpine-sshd/tree/master/versions/7.4/Dockerfile))
- `7.2` (OpenSSH_7.2p2-hpn14v4, OpenSSL 1.0.2j 26 Sep 2016, [Dockerfile](https://github.com/sickp/docker-alpine-sshd/tree/master/versions/7.2/Dockerfile))
Expand All @@ -20,7 +21,7 @@ The root password is "root". SSH host keys (RSA, DSA, ECDSA, and ED25519) are au
### Basic Usage

```bash
$ docker run --rm --publish=2222:22 sickp/alpine-sshd:7.5-r2 # /entrypoint.sh
$ docker run --rm --publish=2222:22 sickp/alpine-sshd:7.9-r1 # /entrypoint.sh
ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519
Server listening on 0.0.0.0 port 22.
Server listening on :: port 22.
Expand All @@ -29,27 +30,27 @@ $ ssh root@localhost -p 2222 # or $(docker-machine ip default)
# The root password is "root".

$ docker ps | grep 2222
cf8097ea881d sickp/alpine-sshd:7.5-r2 "/entrypoint.sh" 8 seconds ago Up 4 seconds 0.0.0.0:2222->22/tcp stoic_ptolemy
cf8097ea881d sickp/alpine-sshd:7.9-r1 "/entrypoint.sh" 8 seconds ago Up 4 seconds 0.0.0.0:2222->22/tcp stoic_ptolemy
$ docker stop cf80
```

Any arguments are passed to `sshd`. For example, to enable debug output:

```bash
$ docker run --rm --publish=2222:22 sickp/alpine-sshd:7.5 -o LogLevel=DEBUG
$ docker run --rm --publish=2222:22 sickp/alpine-sshd:7.9-r1 -o LogLevel=DEBUG
...
```

#### Version Info

```bash
$ docker run --rm sickp/alpine-sshd:7.5-r2 -v
$ docker run --rm sickp/alpine-sshd:7.9-r1 -v
...
OpenSSH_7.5p1-hpn14v4, LibreSSL 2.6.3
OpenSSH_7.9p1, OpenSSL 1.1.1b 26 Feb 2019
...

$ docker run --rm --entrypoint=cat sickp/alpine-sshd:7.5-r2 /etc/alpine-release
3.7.0
$ docker run --rm --entrypoint=cat sickp/alpine-sshd:7.9-r1 /etc/alpine-release
3.9.4
```

### Customize
Expand Down Expand Up @@ -110,6 +111,7 @@ RUN \

### History

2019-05-18 Updated to OpenSSH_7.9p1, OpenSSL 1.1.1b (Alpine Linux 3.9.4).
2018-02-22 Updated to OpenSSH_7.5.p1-hpn14v4, LibreSSL 2.6.3 (Alpine Linux 3.7.0).
2017-05-31 Updated to OpenSSH_7.5p1, LibreSSL 2.5.4 (Alpine Linux 3.6.0).
2017-02-01 Updated to OpenSSH_7.4p1, LibreSSL 2.4.4 (Alpine Linux 3.5.0).
Expand Down
3 changes: 1 addition & 2 deletions push
Expand Up @@ -3,7 +3,7 @@ repo='sickp/alpine-sshd'

def error(message)
puts message
puts "Usage: #{__FILE__} {major}.{minor} [latest]"
puts "Usage: #{__FILE__} {major}.{minor}-r1 [tags...]"
exit 1
end

Expand All @@ -14,7 +14,6 @@ end

version, *tags = ARGV
error("Bad version format: #{version}") unless version&.match?(/\A\d+\.\d+(-r\d+)?\z/)
error("Unexpected tags: #{tags.join(', ')}") unless tags.empty? || (tags.first == 'latest')

dockerfile = File.join(File.dirname(__FILE__), 'versions', version, 'Dockerfile')
error("Missing Dockerfile #{dockerfile}") unless File.file?(dockerfile)
Expand Down
9 changes: 9 additions & 0 deletions versions/7.9-r1/Dockerfile
@@ -0,0 +1,9 @@
FROM alpine:3.9
LABEL maintainer "Adrian B. Danieli - https://github.com/sickp"
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 22
COPY rootfs /

RUN apk add --no-cache openssh \
&& sed -i s/#PermitRootLogin.*/PermitRootLogin\ yes/ /etc/ssh/sshd_config \
&& echo "root:root" | chpasswd
7 changes: 7 additions & 0 deletions versions/7.9-r1/rootfs/entrypoint.sh
@@ -0,0 +1,7 @@
#!/bin/ash

# generate host keys if not present
ssh-keygen -A

# do not detach (-D), log to stderr (-e), passthrough other arguments
exec /usr/sbin/sshd -D -e "$@"

0 comments on commit 22fe8db

Please sign in to comment.