mirror of
https://github.com/vimagick/dockerfiles
synced 2024-06-30 18:51:24 +00:00
add openssh
This commit is contained in:
parent
7ea14b9fd9
commit
6d3d2f7843
@ -31,6 +31,7 @@ A collection of delicious docker recipes.
|
|||||||
- [ ] irc
|
- [ ] irc
|
||||||
- [ ] libreswan
|
- [ ] libreswan
|
||||||
- [ ] mitmproxy
|
- [ ] mitmproxy
|
||||||
|
- [ ] nagios
|
||||||
- [ ] nfs
|
- [ ] nfs
|
||||||
- [ ] openldap
|
- [ ] openldap
|
||||||
- [ ] openswan
|
- [ ] openswan
|
||||||
@ -69,6 +70,7 @@ A collection of delicious docker recipes.
|
|||||||
- [x] nginx
|
- [x] nginx
|
||||||
- [x] nullmailer
|
- [x] nullmailer
|
||||||
- [x] nullmailer-arm
|
- [x] nullmailer-arm
|
||||||
|
- [x] openssh
|
||||||
- [x] phantomjs
|
- [x] phantomjs
|
||||||
- [x] plex :moneybag:
|
- [x] plex :moneybag:
|
||||||
- [x] portia
|
- [x] portia
|
||||||
@ -172,6 +174,8 @@ A collection of delicious docker recipes.
|
|||||||
- [x] dnscrypt
|
- [x] dnscrypt
|
||||||
- [x] dnscrypt-proxy
|
- [x] dnscrypt-proxy
|
||||||
- [x] dnscrypt-wrapper
|
- [x] dnscrypt-wrapper
|
||||||
|
- [x] dnsmasq
|
||||||
|
- [x] dnsmasq-arm
|
||||||
- [x] pdnsd
|
- [x] pdnsd
|
||||||
|
|
||||||
## 3rd-party
|
## 3rd-party
|
||||||
|
21
openssh/Dockerfile
Normal file
21
openssh/Dockerfile
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#
|
||||||
|
# Dockerfile for openssh
|
||||||
|
#
|
||||||
|
|
||||||
|
FROM alpine
|
||||||
|
MAINTAINER kev <noreply@easypi.info>
|
||||||
|
|
||||||
|
RUN set -xe \
|
||||||
|
&& apk add --no-cache openssh \
|
||||||
|
&& mkdir -p 700 /root/.ssh \
|
||||||
|
&& mv /etc/ssh /root/.ssh/ssh \
|
||||||
|
&& ln -s /root/.ssh/ssh /etc/ssh
|
||||||
|
|
||||||
|
COPY docker-entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
|
WORKDIR /root
|
||||||
|
VOLUME /root
|
||||||
|
|
||||||
|
EXPOSE 22
|
||||||
|
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
34
openssh/README.md
Normal file
34
openssh/README.md
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
openssh
|
||||||
|
=======
|
||||||
|
|
||||||
|
## docker-compose.yml
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
openssh:
|
||||||
|
image: vimagick/openssh
|
||||||
|
hostname: alpine
|
||||||
|
ports:
|
||||||
|
- "2222:22"
|
||||||
|
volumes:
|
||||||
|
- ./keys:/root/.ssh/keys
|
||||||
|
restart: always
|
||||||
|
```
|
||||||
|
|
||||||
|
## up and running
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ cd ~/fig/openssh/
|
||||||
|
|
||||||
|
$ tree keys
|
||||||
|
├── joe.pub
|
||||||
|
├── kev.pub
|
||||||
|
└── tom.pub
|
||||||
|
|
||||||
|
$ docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
## ssh login
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ ssh -p 2222 root@server
|
||||||
|
```
|
8
openssh/docker-compose.yml
Normal file
8
openssh/docker-compose.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
openssh:
|
||||||
|
image: vimagick/openssh
|
||||||
|
hostname: alpine
|
||||||
|
ports:
|
||||||
|
- "2222:22"
|
||||||
|
volumes:
|
||||||
|
- ./keys:/root/.ssh/keys
|
||||||
|
restart: always
|
12
openssh/docker-entrypoint.sh
Executable file
12
openssh/docker-entrypoint.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
cd /root/.ssh
|
||||||
|
|
||||||
|
if [ -d keys ]
|
||||||
|
then
|
||||||
|
cat keys/*.pub > authorized_keys
|
||||||
|
fi
|
||||||
|
|
||||||
|
ssh-keygen -A
|
||||||
|
|
||||||
|
exec /usr/sbin/sshd -D "$@"
|
1
openssh/keys/joe.pub
Normal file
1
openssh/keys/joe.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDkMU5DVW4xWDpnbJtVGR85xG06EmzVNYTYEABWHsHNlU3otW0XmEaFlUna2t54+ETupL1mGAHh0SNUhBdf7GgYv73QsqNSrOhh8w0Mx50hq2W7A6SDlXOEme7KjeZXPPZmo8e0qSnkemczh2u6K+S4mXZ5ou7oCg+yJxs+JWZlxi+w759gnyy39qj196ZWLosCAAFhekcdF9b17G7NQNsmht82SfJQP+WYjzs6vAaHSFvCuBq7lnyKudqVrcxEQ+lRIEfur1SHR108Vl5yGlWKeWQEQ+kw/fBHt89ma1MT97VfO318Rz63cOlJPvgR/2Yec8Qhx0tQBmS3Q1EuBZa7 kev@localhost
|
1
openssh/keys/kev.pub
Normal file
1
openssh/keys/kev.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDkMU5DVW4xWDpnbJtVGR85xG06EmzVNYTYEABWHsHNlU3otW0XmEaFlUna2t54+ETupL1mGAHh0SNUhBdf7GgYv73QsqNSrOhh8w0Mx50hq2W7A6SDlXOEme7KjeZXPPZmo8e0qSnkemczh2u6K+S4mXZ5ou7oCg+yJxs+JWZlxi+w759gnyy39qj196ZWLosCAAFhekcdF9b17G7NQNsmht82SfJQP+WYjzs6vAaHSFvCuBq7lnyKudqVrcxEQ+lRIEfur1SHR108Vl5yGlWKeWQEQ+kw/fBHt89ma1MT97VfO318Rz63cOlJPvgR/2Yec8Qhx0tQBmS3Q1EuBZa7 kev@localhost
|
1
openssh/keys/tom.pub
Normal file
1
openssh/keys/tom.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDkMU5DVW4xWDpnbJtVGR85xG06EmzVNYTYEABWHsHNlU3otW0XmEaFlUna2t54+ETupL1mGAHh0SNUhBdf7GgYv73QsqNSrOhh8w0Mx50hq2W7A6SDlXOEme7KjeZXPPZmo8e0qSnkemczh2u6K+S4mXZ5ou7oCg+yJxs+JWZlxi+w759gnyy39qj196ZWLosCAAFhekcdF9b17G7NQNsmht82SfJQP+WYjzs6vAaHSFvCuBq7lnyKudqVrcxEQ+lRIEfur1SHR108Vl5yGlWKeWQEQ+kw/fBHt89ma1MT97VfO318Rz63cOlJPvgR/2Yec8Qhx0tQBmS3Q1EuBZa7 kev@localhost
|
Loading…
Reference in New Issue
Block a user