Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit 76517ed

Browse files
authored
Merge pull request #593 from jdeathe/centos-7-develop
Release changes for 2.4.1
2 parents a1afacb + ca8b045 commit 76517ed

File tree

14 files changed

+393
-30
lines changed

14 files changed

+393
-30
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
Summary of release changes for Version 2 - CentOS-7
66

7+
### 2.4.1 - 2018-11-10
8+
9+
- Adds feature to set system time zone via `SSH_TIMEZONE`.
10+
- Adds feature to enable password authentication.
11+
- Adds default of removing insecure public key when enabling password authentication.
12+
713
### 2.4.0 - 2018-08-12
814

915
- Updates source tag to CentOS 7.5.1804.

Dockerfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,23 +133,25 @@ EXPOSE 22
133133
# Set default environment variables
134134
# -----------------------------------------------------------------------------
135135
ENV SSH_AUTHORIZED_KEYS="" \
136-
SSH_AUTOSTART_SSHD=true \
137-
SSH_AUTOSTART_SSHD_BOOTSTRAP=true \
136+
SSH_AUTOSTART_SSHD="true" \
137+
SSH_AUTOSTART_SSHD_BOOTSTRAP="true" \
138138
SSH_CHROOT_DIRECTORY="%h" \
139-
SSH_INHERIT_ENVIRONMENT=false \
139+
SSH_INHERIT_ENVIRONMENT="false" \
140+
SSH_PASSWORD_AUTHENTICATION="false" \
140141
SSH_SUDO="ALL=(ALL) ALL" \
142+
SSH_TIMEZONE="UTC" \
141143
SSH_USER="app-admin" \
142-
SSH_USER_FORCE_SFTP=false \
144+
SSH_USER_FORCE_SFTP="false" \
143145
SSH_USER_HOME="/home/%u" \
144146
SSH_USER_ID="500:500" \
145147
SSH_USER_PASSWORD="" \
146-
SSH_USER_PASSWORD_HASHED=false \
148+
SSH_USER_PASSWORD_HASHED="false" \
147149
SSH_USER_SHELL="/bin/bash"
148150

149151
# -----------------------------------------------------------------------------
150152
# Set image metadata
151153
# -----------------------------------------------------------------------------
152-
ARG RELEASE_VERSION="2.4.0"
154+
ARG RELEASE_VERSION="2.4.1"
153155
LABEL \
154156
maintainer="James Deathe <james.deathe@gmail.com>" \
155157
install="docker run \

README.md

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ Includes public key authentication, Automated password generation and supports c
77

88
## Overview & links
99

10-
The latest CentOS-6 / CentOS-7 based releases can be pulled from the `centos-6` / `centos-7` Docker tags respectively. For production use it is recommended to select a specific release tag - the convention is `centos-6-1.9.0` OR `1.9.0` for the [1.9.0](https://github.com/jdeathe/centos-ssh/tree/1.9.0) release tag and `centos-7-2.4.0` OR `2.4.0` for the [2.4.0](https://github.com/jdeathe/centos-ssh/tree/2.4.0) release tag.
10+
The latest CentOS-6 / CentOS-7 based releases can be pulled from the `centos-6` / `centos-7` Docker tags respectively. For production use it is recommended to select a specific release tag - the convention is `centos-6-1.9.1` OR `1.9.1` for the [1.9.1](https://github.com/jdeathe/centos-ssh/tree/1.9.1) release tag and `centos-7-2.4.1` OR `2.4.1` for the [2.4.1](https://github.com/jdeathe/centos-ssh/tree/2.4.1) release tag.
1111

1212
### Tags and respective `Dockerfile` links
1313

14-
- `centos-7`,`centos-7-2.4.0`,`2.4.0` [(centos-7/Dockerfile)](https://github.com/jdeathe/centos-ssh/blob/centos-7/Dockerfile)
15-
- `centos-6`,`centos-6-1.9.0`,`1.9.0` [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh/blob/centos-6/Dockerfile)
14+
- `centos-7`,`centos-7-2.4.1`,`2.4.1` [(centos-7/Dockerfile)](https://github.com/jdeathe/centos-ssh/blob/centos-7/Dockerfile)
15+
- `centos-6`,`centos-6-1.9.1`,`1.9.1` [(centos-6/Dockerfile)](https://github.com/jdeathe/centos-ssh/blob/centos-6/Dockerfile)
1616

1717
The Dockerfile can be used to build a base image that is the bases for several other docker images.
1818

@@ -105,10 +105,10 @@ $ docker run \
105105
--rm \
106106
--privileged \
107107
--volume /:/media/root \
108-
jdeathe/centos-ssh:2.4.0 \
108+
jdeathe/centos-ssh:2.4.1 \
109109
/usr/sbin/scmi install \
110110
--chroot=/media/root \
111-
--tag=2.4.0 \
111+
--tag=2.4.1 \
112112
--name=ssh.pool-1.1.1 \
113113
--setopt="--volume {{NAME}}.config-ssh:/etc/ssh"
114114
```
@@ -122,10 +122,10 @@ $ docker run \
122122
--rm \
123123
--privileged \
124124
--volume /:/media/root \
125-
jdeathe/centos-ssh:2.4.0 \
125+
jdeathe/centos-ssh:2.4.1 \
126126
/usr/sbin/scmi uninstall \
127127
--chroot=/media/root \
128-
--tag=2.4.0 \
128+
--tag=2.4.1 \
129129
--name=ssh.pool-1.1.1 \
130130
--setopt="--volume {{NAME}}.config-ssh:/etc/ssh"
131131
```
@@ -139,10 +139,10 @@ $ docker run \
139139
--rm \
140140
--privileged \
141141
--volume /:/media/root \
142-
jdeathe/centos-ssh:2.4.0 \
142+
jdeathe/centos-ssh:2.4.1 \
143143
/usr/sbin/scmi install \
144144
--chroot=/media/root \
145-
--tag=2.4.0 \
145+
--tag=2.4.1 \
146146
--name=ssh.pool-1.1.1 \
147147
--manager=systemd \
148148
--register \
@@ -164,7 +164,7 @@ Since release tags `1.7.2` / `2.1.2` the install template has been added to the
164164
_NOTE:_ A prerequisite of the following examples is that the image has been pulled (or loaded from the release package).
165165

166166
```
167-
$ docker pull jdeathe/centos-ssh:2.4.0
167+
$ docker pull jdeathe/centos-ssh:2.4.1
168168
```
169169

170170
To see detailed information about the image run `scmi` with the `--info` option. To see all available `scmi` options run with the `--help` option.
@@ -173,7 +173,7 @@ To see detailed information about the image run `scmi` with the `--info` option.
173173
$ eval "sudo -E $(
174174
docker inspect \
175175
-f "{{.ContainerConfig.Labels.install}}" \
176-
jdeathe/centos-ssh:2.4.0
176+
jdeathe/centos-ssh:2.4.1
177177
) --info"
178178
```
179179

@@ -183,7 +183,7 @@ To perform an installation using the docker name `ssh.pool-1.2.1` simply use the
183183
$ eval "sudo -E $(
184184
docker inspect \
185185
-f "{{.ContainerConfig.Labels.install}}" \
186-
jdeathe/centos-ssh:2.4.0
186+
jdeathe/centos-ssh:2.4.1
187187
) --name=ssh.pool-1.2.1"
188188
```
189189

@@ -193,7 +193,7 @@ To uninstall use the *same command* that was used to install but with the `unins
193193
$ eval "sudo -E $(
194194
docker inspect \
195195
-f "{{.ContainerConfig.Labels.uninstall}}" \
196-
jdeathe/centos-ssh:2.4.0
196+
jdeathe/centos-ssh:2.4.1
197197
) --name=ssh.pool-1.2.1"
198198
```
199199

@@ -206,7 +206,7 @@ To see detailed information about the image run `scmi` with the `--info` option.
206206
```
207207
$ sudo -E atomic install \
208208
-n ssh.pool-1.3.1 \
209-
jdeathe/centos-ssh:2.4.0 \
209+
jdeathe/centos-ssh:2.4.1 \
210210
--info
211211
```
212212

@@ -215,14 +215,14 @@ To perform an installation using the docker name `ssh.pool-1.3.1` simply use the
215215
```
216216
$ sudo -E atomic install \
217217
-n ssh.pool-1.3.1 \
218-
jdeathe/centos-ssh:2.4.0
218+
jdeathe/centos-ssh:2.4.1
219219
```
220220

221221
Alternatively, you could use the `scmi` options `--name` or `-n` for naming the container.
222222

223223
```
224224
$ sudo -E atomic install \
225-
jdeathe/centos-ssh:2.4.0 \
225+
jdeathe/centos-ssh:2.4.1 \
226226
--name ssh.pool-1.3.1
227227
```
228228

@@ -231,7 +231,7 @@ To uninstall use the *same command* that was used to install but with the `unins
231231
```
232232
$ sudo -E atomic uninstall \
233233
-n ssh.pool-1.3.1 \
234-
jdeathe/centos-ssh:2.4.0
234+
jdeathe/centos-ssh:2.4.1
235235
```
236236

237237
#### Using environment variables
@@ -359,6 +359,16 @@ The SSH user's environment is reset by default meaning that the Docker environme
359359
...
360360
```
361361

362+
##### SSH_PASSWORD_AUTHENTICATION
363+
364+
The SSH password authentication is disabled by default; allowing access by public/private key based authentication only. This is the recommended configuration however it may be necessary to allow password based access if you have client's that are unable to use key based authentication. Use `SSH_PASSWORD_AUTHENTICATION` to enable password authentication.
365+
366+
```
367+
...
368+
--env "SSH_PASSWORD_AUTHENTICATION=true" \
369+
...
370+
```
371+
362372
##### SSH_SUDO
363373

364374
On first run the SSH user is created with a the sudo rule `ALL=(ALL) ALL` which allows the user to run all commands but a password is required. If you want to limit the access to specific commands or allow sudo without a password prompt `SSH_SUDO` can be used.
@@ -369,6 +379,16 @@ On first run the SSH user is created with a the sudo rule `ALL=(ALL) ALL` which
369379
...
370380
```
371381

382+
##### SSH_TIMEZONE
383+
384+
If you require a locale based system time zone `SSH_TIMEZONE` can be used when running the container.
385+
386+
```
387+
...
388+
--env "SSH_TIMEZONE=Europe/London" \
389+
...
390+
```
391+
372392
##### SSH_USER
373393

374394
On first run the SSH user is created with the default username of "app-admin". If you require an alternative username `SSH_USER` can be used when running the container.

default.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ define DOCKER_CONTAINER_PARAMETERS
88
--env "SSH_AUTOSTART_SSHD_BOOTSTRAP=$(SSH_AUTOSTART_SSHD_BOOTSTRAP)" \
99
--env "SSH_CHROOT_DIRECTORY=$(SSH_CHROOT_DIRECTORY)" \
1010
--env "SSH_INHERIT_ENVIRONMENT=$(SSH_INHERIT_ENVIRONMENT)" \
11+
--env "SSH_PASSWORD_AUTHENTICATION=$(SSH_PASSWORD_AUTHENTICATION)" \
1112
--env "SSH_SUDO=$(SSH_SUDO)" \
1213
--env "SSH_USER=$(SSH_USER)" \
1314
--env "SSH_USER_FORCE_SFTP=$(SSH_USER_FORCE_SFTP)" \

environment.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ SSH_AUTOSTART_SSHD ?= true
3737
SSH_AUTOSTART_SSHD_BOOTSTRAP ?= true
3838
SSH_CHROOT_DIRECTORY ?= %h
3939
SSH_INHERIT_ENVIRONMENT ?= false
40+
SSH_PASSWORD_AUTHENTICATION ?= false
4041
SSH_SUDO ?= ALL=(ALL) ALL
42+
SSH_TIMEZONE ?= UTC
4143
SSH_USER ?= app-admin
4244
SSH_USER_FORCE_SFTP ?= false
4345
SSH_USER_HOME ?= /home/%u
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key

src/etc/services-config/ssh/sshd-bootstrap.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
SSH_AUTHORIZED_KEYS="${SSH_AUTHORIZED_KEYS:-}"
22
SSH_CHROOT_DIRECTORY="${SSH_CHROOT_DIRECTORY:-%h}"
33
SSH_INHERIT_ENVIRONMENT="${SSH_INHERIT_ENVIRONMENT:-false}"
4+
SSH_PASSWORD_AUTHENTICATION="${SSH_PASSWORD_AUTHENTICATION:-false}"
45
SSH_ROOT_PASSWORD=
56
SSH_SUDO="${SSH_SUDO:-ALL=(ALL) ALL}"
7+
SSH_TIMEZONE="${SSH_TIMEZONE:-UTC}"
68
SSH_USER="${SSH_USER:-app-admin}"
79
SSH_USER_FORCE_SFTP="${SSH_USER_FORCE_SFTP:-false}"
810
SSH_USER_HOME="${SSH_USER_HOME:-/home/%u}"

src/etc/systemd/system/centos-ssh@.service

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,16 @@ Environment="DOCKER_USER=jdeathe"
5151
Environment="DOCKER_IMAGE_NAME=centos-ssh"
5252
Environment="DOCKER_CONTAINER_OPTS="
5353
Environment="DOCKER_IMAGE_PACKAGE_PATH=/var/opt/scmi/packages"
54-
Environment="DOCKER_IMAGE_TAG=2.4.0"
54+
Environment="DOCKER_IMAGE_TAG=2.4.1"
5555
Environment="DOCKER_PORT_MAP_TCP_22=2020"
5656
Environment="SSH_AUTHORIZED_KEYS="
5757
Environment="SSH_AUTOSTART_SSHD=true"
5858
Environment="SSH_AUTOSTART_SSHD_BOOTSTRAP=true"
5959
Environment="SSH_CHROOT_DIRECTORY=%%h"
6060
Environment="SSH_INHERIT_ENVIRONMENT=false"
61+
Environment="SSH_PASSWORD_AUTHENTICATION=false"
6162
Environment="SSH_SUDO=ALL=(ALL) ALL"
63+
Environment="SSH_TIMEZONE=UTC"
6264
Environment="SSH_USER=app-admin"
6365
Environment="SSH_USER_FORCE_SFTP=false"
6466
Environment="SSH_USER_HOME=/home/%%u"
@@ -100,7 +102,9 @@ ExecStart=/bin/bash -c \
100102
--env \"SSH_AUTOSTART_SSHD_BOOTSTRAP=${SSH_AUTOSTART_SSHD_BOOTSTRAP}\" \
101103
--env \"SSH_CHROOT_DIRECTORY=${SSH_CHROOT_DIRECTORY}\" \
102104
--env \"SSH_INHERIT_ENVIRONMENT=${SSH_INHERIT_ENVIRONMENT}\" \
105+
--env \"SSH_PASSWORD_AUTHENTICATION=${SSH_PASSWORD_AUTHENTICATION}\" \
103106
--env \"SSH_SUDO=${SSH_SUDO}\" \
107+
--env \"SSH_TIMEZONE=${SSH_TIMEZONE}\" \
104108
--env \"SSH_USER=${SSH_USER}\" \
105109
--env \"SSH_USER_FORCE_SFTP=${SSH_USER_FORCE_SFTP}\" \
106110
--env \"SSH_USER_HOME=${SSH_USER_HOME}\" \

src/opt/scmi/default.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ DOCKER_CONTAINER_PARAMETERS="--name ${DOCKER_NAME} \
2727
--env \"SSH_AUTOSTART_SSHD_BOOTSTRAP=${SSH_AUTOSTART_SSHD_BOOTSTRAP}\" \
2828
--env \"SSH_CHROOT_DIRECTORY=${SSH_CHROOT_DIRECTORY}\" \
2929
--env \"SSH_INHERIT_ENVIRONMENT=${SSH_INHERIT_ENVIRONMENT}\" \
30+
--env \"SSH_PASSWORD_AUTHENTICATION=${SSH_PASSWORD_AUTHENTICATION}\" \
3031
--env \"SSH_SUDO=${SSH_SUDO}\" \
32+
--env \"SSH_TIMEZONE=${SSH_TIMEZONE}\" \
3133
--env \"SSH_USER=${SSH_USER}\" \
3234
--env \"SSH_USER_FORCE_SFTP=${SSH_USER_FORCE_SFTP}\" \
3335
--env \"SSH_USER_HOME=${SSH_USER_HOME}\" \

src/opt/scmi/environment.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ SSH_AUTOSTART_SSHD="${SSH_AUTOSTART_SSHD:-true}"
3939
SSH_AUTOSTART_SSHD_BOOTSTRAP="${SSH_AUTOSTART_SSHD_BOOTSTRAP:-true}"
4040
SSH_CHROOT_DIRECTORY="${SSH_CHROOT_DIRECTORY:-%h}"
4141
SSH_INHERIT_ENVIRONMENT="${SSH_INHERIT_ENVIRONMENT:-false}"
42+
SSH_PASSWORD_AUTHENTICATION="${SSH_PASSWORD_AUTHENTICATION:-false}"
4243
SSH_SUDO="${SSH_SUDO:-ALL=(ALL) ALL}"
44+
SSH_TIMEZONE="${SSH_TIMEZONE:-UTC}"
4345
SSH_USER="${SSH_USER:-app-admin}"
4446
SSH_USER_FORCE_SFTP="${SSH_USER_FORCE_SFTP:-false}"
4547
SSH_USER_HOME="${SSH_USER_HOME:-/home/%u}"

src/opt/scmi/service-unit.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ readonly SERVICE_UNIT_ENVIRONMENT_KEYS="
1111
SSH_AUTOSTART_SSHD_BOOTSTRAP
1212
SSH_CHROOT_DIRECTORY
1313
SSH_INHERIT_ENVIRONMENT
14+
SSH_PASSWORD_AUTHENTICATION
1415
SSH_SUDO
16+
SSH_TIMEZONE
1517
SSH_USER
1618
SSH_USER_FORCE_SFTP
1719
SSH_USER_HOME

0 commit comments

Comments
 (0)