Skip to content

Commit

Permalink
Merge branch 'release/1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Mofasser committed Aug 9, 2018
2 parents d00ed6b + ff4b040 commit 7b8d4a1
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
FROM alpine:3.6
FROM alpine:3.7

LABEL maintainer="Amir Mofasser (@amimof)"

COPY sshd_config /etc/ssh/sshd_config
COPY server /

RUN apk add --no-cache --update openssh bash \
RUN set -x \
&& apk add --no-cache --update openssh bash \
&& mkdir -p /var/run/sshd \
&& chmod +x /server

EXPOSE 22

CMD ["/server"]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ $ docker run \
ssh-keygen -t rsa -b 4096 -f ~/mykeys/ssh_host_rsa_key

# dsa
ssh-keygen -t dsa -f ~/mykeys/ssh_host_rsa_key
ssh-keygen -t dsa -f ~/mykeys/ssh_host_dsa_key

# ecdsa
ssh-keygen -t ecdsa -f ~/mykeys/ssh_host_rsa_key
ssh-keygen -t ecdsa -f ~/mykeys/ssh_host_ecdsa_key

# ed25519
ssh-keygen -t ed25519 -f ~/mykeys/ssh_host_rsa_key
ssh-keygen -t ed25519 -f ~/mykeys/ssh_host_ed25519_key
```
16 changes: 16 additions & 0 deletions pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
apiVersion: v1
kind: Pod
metadata:
name: sftp
spec:
containers:
- name: sftp
image: amimof/sftp
env:
- name: SSH_USERNAME
value: "beyonce"
- name: SSH_PASSWORD
value: "knowles"
ports:
- containerPort: 22
6 changes: 6 additions & 0 deletions server
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ else
sed -i "s/PasswordAuthentication\s[^ ]*/PasswordAuthentication yes/g" /etc/ssh/sshd_config
fi

# Set Port to listen on
if [ ! -z "$SSH_PORT" ]; then
echo "INFO: Setting Port to ${SSH_PORT}"
sed -i "s/Port\s[^ ]*/Port ${SSH_PORT}/g" /etc/ssh/sshd_config
fi

# Change ownership and permissions of users home root dir
echo "INFO: Change ownership and permissions of home directory"
chown root:root /home/$SSH_USERNAME
Expand Down
1 change: 1 addition & 0 deletions sshd_config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Protocol 2
Port 22
UseDNS no
PermitRootLogin no
X11Forwarding no
Expand Down

0 comments on commit 7b8d4a1

Please sign in to comment.