forked from rucio/containers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request rucio#138 from rak108/GSOC-2021
SSH Docker Container
- Loading branch information
Showing
6 changed files
with
146 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-----BEGIN OPENSSH PRIVATE KEY----- | ||
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAAAdzc2gtcn | ||
NhAAAAAwEAAQAAAQEA3PzQJVs/f2pVlY8TEBLwuZ1uHAbFwMSFKDf59/L2hifgWUbeD2HK | ||
iT6CQJDInvyvyQuNc9uWnMWAUxC6x7/KYuc7Ro1HZdQEuNx0xC9CWrhs32+Aj0HO59qHyY | ||
UHf6r1t6HwDjWXpu6WIw+SWlLDx6u3uZXh56GGS+wVGuQqsPML9k77jF5wKiAt9F0xueI7 | ||
XXfSyZXtO76QugZTxAkaRqfglxy/gagH1cxBK5+Nw7WjeXZZtGZyAjAmyVD83VHuIGPnMB | ||
xpe70bhiwo9yW/vOAe2mTo2Uqv00mDfxgPAjs8/gCgZvUiGVXRQgqyYULjo3/oG4RQH4nX | ||
lJHBKN/7IwAAA8AgOIDKIDiAygAAAAdzc2gtcnNhAAABAQDc/NAlWz9/alWVjxMQEvC5nW | ||
4cBsXAxIUoN/n38vaGJ+BZRt4PYcqJPoJAkMie/K/JC41z25acxYBTELrHv8pi5ztGjUdl | ||
1AS43HTEL0JauGzfb4CPQc7n2ofJhQd/qvW3ofAONZem7pYjD5JaUsPHq7e5leHnoYZL7B | ||
Ua5Cqw8wv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XxMcQ1+9bKR8ZpJYLVK | ||
WXEkkOfjJMAiUBsAAAAIc3NoIGtleXMBAgM= | ||
-----END OPENSSH PRIVATE KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDc/NAlWz9/alWVjxMQEvC5nW4cBsXAxIUoN/n38vaGJ+BZRt4PYcqJPoJAkMie/K/JC41z25acxYBTELrHv8pi5ztGjUdl1AS43HTEL0JauGzfb4CPQc7n2ofJhQd/qvW3ofAONZem7pYjD5JaUsPHq7e5leHnoYZL7BUa5Cqw8wv2TvuMXnAqIC30XTG54jtdd9LJle07vpC6BlPECRpGp+CXHL+BqAfVzEErn43DtaN5dlm0ZnICMCbJUPzdUe4gY+cwHGl7vRuGLCj3Jb+84B7aZOjZSq/TSYN/GA8COzz+AKBm9SIZVdFCCrJhQuOjf+gbhFAfideUkcEo3/sj ssh keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM centos:7 | ||
|
||
# Install OpenSSH | ||
RUN yum install -y epel-release.noarch | ||
RUN yum upgrade -y | ||
RUN yum -y install openssh-server openssh-clients sudo python3-pip && \ | ||
pip3 install -U dumb-init | ||
RUN yum clean all && \ | ||
rm -rf /var/cache/yum | ||
|
||
# Server config | ||
RUN /usr/bin/ssh-keygen -A && \ | ||
echo '' > /tmp/sshkey.pub | ||
COPY sshd_config /etc/ssh/sshd_config | ||
|
||
# Create storage area | ||
RUN mkdir /rucio /root/.ssh && \ | ||
echo '' > /root/.ssh/authorized_keys | ||
|
||
# Startup | ||
EXPOSE 22 | ||
ADD docker-entrypoint.sh / | ||
ENTRYPOINT ["/usr/local/bin/dumb-init", "--"] | ||
CMD ["/bin/bash", "/docker-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
echo "Starting sshd service.." | ||
cp /tmp/sshkey.pub /root/.ssh/authorized_keys | ||
chown root:root /root/.ssh/authorized_keys && chmod 0600 /root/.ssh/authorized_keys | ||
echo '======== /etc/ssh/sshd_config ========' | ||
cat /etc/ssh/sshd_config | ||
echo '==========================================' | ||
exec /usr/sbin/sshd -D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# What ports, IPs and protocols we listen for | ||
Port 22 | ||
# Use these options to restrict which interfaces/protocols sshd will bind to | ||
#ListenAddress :: | ||
#ListenAddress 0.0.0.0 | ||
Protocol 2 | ||
# HostKeys for protocol version 2 | ||
HostKey /etc/ssh/ssh_host_rsa_key | ||
HostKey /etc/ssh/ssh_host_dsa_key | ||
HostKey /etc/ssh/ssh_host_ecdsa_key | ||
HostKey /etc/ssh/ssh_host_ed25519_key | ||
#Privilege Separation is turned on for security | ||
UsePrivilegeSeparation yes | ||
|
||
# Logging | ||
SyslogFacility AUTH | ||
LogLevel INFO | ||
|
||
# Authentication: | ||
LoginGraceTime 120 | ||
PermitRootLogin yes | ||
StrictModes yes | ||
|
||
PubkeyAuthentication yes | ||
AuthorizedKeysFile /root/.ssh/authorized_keys | ||
|
||
# Don't read the user's ~/.rhosts and ~/.shosts files | ||
IgnoreRhosts yes | ||
# similar for protocol version 2 | ||
HostbasedAuthentication no | ||
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication | ||
#IgnoreUserKnownHosts yes | ||
|
||
# To enable empty passwords, change to yes (NOT RECOMMENDED) | ||
PermitEmptyPasswords no | ||
|
||
# Change to yes to enable challenge-response passwords (beware issues with | ||
# some PAM modules and threads) | ||
ChallengeResponseAuthentication no | ||
|
||
# Change to no to disable tunnelled clear text passwords | ||
PasswordAuthentication no | ||
|
||
# Kerberos options | ||
#KerberosAuthentication no | ||
#KerberosGetAFSToken no | ||
#KerberosOrLocalPasswd yes | ||
#KerberosTicketCleanup yes | ||
|
||
# GSSAPI options | ||
#GSSAPIAuthentication no | ||
#GSSAPICleanupCredentials yes | ||
|
||
X11Forwarding yes | ||
X11DisplayOffset 10 | ||
PrintMotd no | ||
PrintLastLog yes | ||
TCPKeepAlive yes | ||
#UseLogin no | ||
|
||
#MaxStartups 10:30:60 | ||
#Banner /etc/issue.net | ||
|
||
# Allow client to pass locale environment variables | ||
AcceptEnv LANG LC_* | ||
|
||
Subsystem sftp /usr/lib/openssh/sftp-server | ||
|
||
# Set this to 'yes' to enable PAM authentication, account processing, | ||
# and session processing. If this is enabled, PAM authentication will | ||
# be allowed through the ChallengeResponseAuthentication and | ||
# PasswordAuthentication. Depending on your PAM configuration, | ||
# PAM authentication via ChallengeResponseAuthentication may bypass | ||
# the setting of "PermitRootLogin without-password". | ||
# If you just want the PAM account and session checks to run without | ||
# PAM authentication, then enable this but set PasswordAuthentication | ||
# and ChallengeResponseAuthentication to 'no'. | ||
UsePAM yes |