You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 2, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+27-24Lines changed: 27 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -7,18 +7,18 @@ Includes public key authentication, Automated password generation and supports c
7
7
8
8
## Overview & links
9
9
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.10.0` OR `1.10.0` for the [1.10.0](https://github.com/jdeathe/centos-ssh/tree/1.10.0) release tag and `centos-7-2.5.0` OR `2.5.0` for the [2.5.0](https://github.com/jdeathe/centos-ssh/tree/2.5.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.10.1` OR `1.10.1` for the [1.10.1](https://github.com/jdeathe/centos-ssh/tree/1.10.1) release tag and `centos-7-2.5.1` OR `2.5.1` for the [2.5.1](https://github.com/jdeathe/centos-ssh/tree/2.5.1) release tag.
The Dockerfile can be used to build a base image that is the bases for several other docker images.
18
18
19
-
Included in the build are the [SCL](https://www.softwarecollections.org/), [EPEL](http://fedoraproject.org/wiki/EPEL) and [IUS](https://ius.io) repositories. Installed packages include [OpenSSH](http://www.openssh.com/portable.html) secure shell, [Sudo](http://www.courtesan.com/sudo/) and [vim-minimal](http://www.vim.org/) are along with python-setuptools, [supervisor](http://supervisord.org/) and [supervisor-stdout](https://github.com/coderanger/supervisor-stdout).
19
+
Included in the build are the [SCL](https://www.softwarecollections.org/), [EPEL](http://fedoraproject.org/wiki/EPEL) and [IUS](https://ius.io) repositories. Installed packages include [OpenSSH](http://www.openssh.com/portable.html) secure shell, [Sudo](http://www.courtesan.com/sudo/) and [vim-minimal](http://www.vim.org/) are along with [supervisor](http://supervisord.org/) and [supervisor-stdout](https://github.com/coderanger/supervisor-stdout).
20
20
21
-
[Supervisor](http://supervisord.org/) is used to start and the sshd daemon when a docker container based on this image is run. To enable simple viewing of stdout for the sshd subprocess, supervisor-stdout is included. This allows you to see output from the supervisord controlled subprocesses with `docker logs {container-name}`.
21
+
[Supervisor](http://supervisord.org/) is used to start and the sshd daemon when a docker container based on this image is run.
22
22
23
23
SSH access is by public key authentication and, by default, the [Vagrant](http://www.vagrantup.com/)[insecure private key](https://github.com/mitchellh/vagrant/blob/master/keys/vagrant) is required.
24
24
@@ -42,7 +42,7 @@ Run up an SSH container named 'ssh.1' from the docker image 'jdeathe/centos-ssh'
42
42
$ docker run -d \
43
43
--name ssh.1 \
44
44
-p 2020:22 \
45
-
jdeathe/centos-ssh:2.5.0
45
+
jdeathe/centos-ssh:2.5.1
46
46
```
47
47
48
48
Check the logs for the password (required for sudo).
@@ -76,7 +76,7 @@ $ docker run -d \
76
76
--name sftp.1 \
77
77
-p 2021:22 \
78
78
-e SSH_USER_FORCE_SFTP=true \
79
-
jdeathe/centos-ssh:2.5.0
79
+
jdeathe/centos-ssh:2.5.1
80
80
```
81
81
82
82
Connect using the `sftp` command line client with the [insecure private key](https://github.com/mitchellh/vagrant/blob/master/keys/vagrant).
@@ -106,10 +106,10 @@ $ docker run \
106
106
--rm \
107
107
--privileged \
108
108
--volume /:/media/root \
109
-
jdeathe/centos-ssh:2.5.0 \
109
+
jdeathe/centos-ssh:2.5.1 \
110
110
/usr/sbin/scmi install \
111
111
--chroot=/media/root \
112
-
--tag=2.5.0 \
112
+
--tag=2.5.1 \
113
113
--name=ssh.1 \
114
114
--setopt="--volume {{NAME}}.config-ssh:/etc/ssh"
115
115
```
@@ -123,10 +123,10 @@ $ docker run \
123
123
--rm \
124
124
--privileged \
125
125
--volume /:/media/root \
126
-
jdeathe/centos-ssh:2.5.0 \
126
+
jdeathe/centos-ssh:2.5.1 \
127
127
/usr/sbin/scmi uninstall \
128
128
--chroot=/media/root \
129
-
--tag=2.5.0 \
129
+
--tag=2.5.1 \
130
130
--name=ssh.1 \
131
131
--setopt="--volume {{NAME}}.config-ssh:/etc/ssh"
132
132
```
@@ -140,10 +140,10 @@ $ docker run \
140
140
--rm \
141
141
--privileged \
142
142
--volume /:/media/root \
143
-
jdeathe/centos-ssh:2.5.0 \
143
+
jdeathe/centos-ssh:2.5.1 \
144
144
/usr/sbin/scmi install \
145
145
--chroot=/media/root \
146
-
--tag=2.5.0 \
146
+
--tag=2.5.1 \
147
147
--name=ssh.1 \
148
148
--manager=systemd \
149
149
--register \
@@ -159,7 +159,7 @@ Since release tags `1.7.2` / `2.1.2` the install template has been added to the
159
159
_NOTE:_ A prerequisite of the following examples is that the image has been pulled (or loaded from the release package).
160
160
161
161
```
162
-
$ docker pull jdeathe/centos-ssh:2.5.0
162
+
$ docker pull jdeathe/centos-ssh:2.5.1
163
163
```
164
164
165
165
To see detailed information about the image run `scmi` with the `--info` option. To see all available `scmi` options run with the `--help` option.
@@ -168,7 +168,7 @@ To see detailed information about the image run `scmi` with the `--info` option.
168
168
$ eval "sudo -E $(
169
169
docker inspect \
170
170
-f "{{.ContainerConfig.Labels.install}}" \
171
-
jdeathe/centos-ssh:2.5.0
171
+
jdeathe/centos-ssh:2.5.1
172
172
) --info"
173
173
```
174
174
@@ -178,7 +178,7 @@ To perform an installation using the docker name `ssh.2` simply use the `--name`
178
178
$ eval "sudo -E $(
179
179
docker inspect \
180
180
-f "{{.ContainerConfig.Labels.install}}" \
181
-
jdeathe/centos-ssh:2.5.0
181
+
jdeathe/centos-ssh:2.5.1
182
182
) --name=ssh.2"
183
183
```
184
184
@@ -188,7 +188,7 @@ To uninstall use the *same command* that was used to install but with the `unins
188
188
$ eval "sudo -E $(
189
189
docker inspect \
190
190
-f "{{.ContainerConfig.Labels.uninstall}}" \
191
-
jdeathe/centos-ssh:2.5.0
191
+
jdeathe/centos-ssh:2.5.1
192
192
) --name=ssh.2"
193
193
```
194
194
@@ -201,7 +201,7 @@ To see detailed information about the image run `scmi` with the `--info` option.
201
201
```
202
202
$ sudo -E atomic install \
203
203
-n ssh.3 \
204
-
jdeathe/centos-ssh:2.5.0 \
204
+
jdeathe/centos-ssh:2.5.1 \
205
205
--info
206
206
```
207
207
@@ -210,14 +210,14 @@ To perform an installation using the docker name `ssh.3` simply use the `-n` opt
210
210
```
211
211
$ sudo -E atomic install \
212
212
-n ssh.3 \
213
-
jdeathe/centos-ssh:2.5.0
213
+
jdeathe/centos-ssh:2.5.1
214
214
```
215
215
216
216
Alternatively, you could use the `scmi` options `--name` or `-n` for naming the container.
217
217
218
218
```
219
219
$ sudo -E atomic install \
220
-
jdeathe/centos-ssh:2.5.0 \
220
+
jdeathe/centos-ssh:2.5.1 \
221
221
--name ssh.3
222
222
```
223
223
@@ -226,7 +226,7 @@ To uninstall use the *same command* that was used to install but with the `unins
226
226
```
227
227
$ sudo -E atomic uninstall \
228
228
-n ssh.3 \
229
-
jdeathe/centos-ssh:2.5.0
229
+
jdeathe/centos-ssh:2.5.1
230
230
```
231
231
232
232
#### Using environment variables
@@ -242,7 +242,7 @@ $ docker stop ssh.1 \
242
242
--name ssh.1 \
243
243
-p :22 \
244
244
--env "SSH_USER=centos" \
245
-
jdeathe/centos-ssh:2.5.0
245
+
jdeathe/centos-ssh:2.5.1
246
246
```
247
247
248
248
To identify the `SSH_USER` user's sudoer password, inspect the container's logs as follows:
@@ -265,8 +265,7 @@ The output of the logs will show the auto-generated password for the user specif
265
265
2019-01-17 18:56:10,089 INFO success: supervisor_stdout entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
266
266
2019-01-17 18:56:10,089 INFO success: sshd-bootstrap entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
267
267
2019-01-17 18:56:10,089 INFO success: sshd-wrapper entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
@@ -335,6 +334,10 @@ It may be desirable to prevent the startup of the sshd daemon and/or sshd-bootst
335
334
...
336
335
```
337
336
337
+
##### SSH_AUTOSTART_SUPERVISOR_STDOUT
338
+
339
+
This image has `supervisor_stdout` installed which can be used to allow a process controlled by supervisord to send output to both a log file and stdout. It is recommended to simply output to stdout in order to reduce the number of running processes to a minimum. Setting `SSH_AUTOSTART_SUPERVISOR_STDOUT` to "false" will prevent the startup of `supervisor_stdout`. Where an image requires this feature for its logging output `SSH_AUTOSTART_SUPERVISOR_STDOUT` should be set to "true".
340
+
338
341
##### SSH_CHROOT_DIRECTORY
339
342
340
343
This option is only applicable when `SSH_USER_FORCE_SFTP` is set to `true`. When using the SFTP option the user is jailed into the ChrootDirectory. The value can contain the placeholders `%h` and `%u` which will be replaced with the values of `SSH_USER_HOME` and `SSH_USER` respectively. The default value of `%h` is the best choice in most cases but the user requires a sub-directory in their HOME directory which they have write access to. If no volume is mounted into the path of the SSH user's HOME directory then a directory named `_data` is created automatically. If you need the user to be able to write to their HOME directory then use an alternative value such as `/chroot/%u` so that the user's HOME path, (relative to the ChrootDirectory), becomes `/chroot/app-admin/home/app-admin` by default.
0 commit comments