mirror of
				https://github.com/MatteZ02/infra.git
				synced 2025-11-04 01:59:33 +00:00 
			
		
		
		
	Update
This commit is contained in:
		
							
								
								
									
										1
									
								
								files/ssh/.dockerignore
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								files/ssh/.dockerignore
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
keys
 | 
			
		||||
							
								
								
									
										15
									
								
								files/ssh/Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								files/ssh/Dockerfile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
			
		||||
FROM docker.io/library/debian
 | 
			
		||||
 | 
			
		||||
RUN apt update && \
 | 
			
		||||
    apt install -y openssh-server rsync git
 | 
			
		||||
 | 
			
		||||
RUN rm -rf /etc/ssh/ssh_host* && \
 | 
			
		||||
    mkdir -p /run/sshd
 | 
			
		||||
 | 
			
		||||
COPY entrypoint.sh /
 | 
			
		||||
 | 
			
		||||
RUN chmod +x entrypoint.sh
 | 
			
		||||
 | 
			
		||||
COPY sshd_config /etc/ssh/sshd_config
 | 
			
		||||
 | 
			
		||||
CMD ./entrypoint.sh
 | 
			
		||||
							
								
								
									
										18
									
								
								files/ssh/entrypoint.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								files/ssh/entrypoint.sh
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
if [[ ! -f /etc/ssh/keys/ssh_host_rsa_key ]]
 | 
			
		||||
then
 | 
			
		||||
  ssh-keygen -b 4096 -f /etc/ssh/keys/ssh_host_rsa_key -t rsa -N ""
 | 
			
		||||
fi
 | 
			
		||||
if [[ ! -f /etc/ssh/keys/ssh_host_ed25519_key ]]
 | 
			
		||||
then
 | 
			
		||||
  ssh-keygen -b 4096 -f /etc/ssh/keys/ssh_host_ed25519_key -t ed25519 -N ""
 | 
			
		||||
fi
 | 
			
		||||
if [[ ! -f /etc/ssh/keys/authorized_keys ]]
 | 
			
		||||
then
 | 
			
		||||
  touch /etc/ssh/keys/authorized_keys
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
cat /etc/ssh/keys/authorized_keys > ~/.ssh/authorized_keys
 | 
			
		||||
 | 
			
		||||
/usr/sbin/sshd -D
 | 
			
		||||
							
								
								
									
										2
									
								
								files/ssh/keys/authorized_keys
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								files/ssh/keys/authorized_keys
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPW5phGhwAG8dmT+sR0uF1gRc0X9xXZiiFxvKUEsPk1N cwchristerw
 | 
			
		||||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC38o1SJu8FRWwGHU9AejwgRRDDV/VEDAyBXvYlEXxyqqNsFWQ42ZYjCRBEprSbvD3sJT65NNdqH+Uv6iV2PBS8+TDQ2oQif+0Ta7hP6V0oOqpOO9/ZAGYFnVs3Mu42/Ya1Lqim1C82ylW63Cmw4GyctkY2+lIaSpP1CpLvFuVR9U0f+AXjpzuy4VXZVKRXs75YGbYkyOoIQ/NZa9ZRcMa19j7Mm2QWDyjlk2i9/GVC/8riJ4MwI1kwiUe+4LFKssghgTsRHjBm5bpgUgEPF+nnNGX0p6RArbaYxd/vLoGWHoO8k4UoElLQERlm8dnXF6yrJkltGBlFjS4o9XANYNEuP23JVROm2ucPmFfH4xVQCRPE/32fQjHRSZUK5W/qO3bNsxCjYhsB6GZWohtktGxnySZBq3I2ziNKr7CwMECUbeew3QxwOC1jmF88k8uR7yCLBEej8hJ2bCwzMYWSdjO/uvqPkQ0GsEj5LkLHc9cfJXHEXTa1Rh8bv2SVCPp5K98= matte
 | 
			
		||||
							
								
								
									
										24
									
								
								files/ssh/sshd_config
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								files/ssh/sshd_config
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,24 @@
 | 
			
		||||
Port 25590
 | 
			
		||||
HostKey /etc/ssh/keys/ssh_host_rsa_key
 | 
			
		||||
HostKey /etc/ssh/keys/ssh_host_ed25519_key
 | 
			
		||||
SyslogFacility AUTHPRIV
 | 
			
		||||
LogLevel VERBOSE
 | 
			
		||||
PermitRootLogin prohibit-password
 | 
			
		||||
MaxAuthTries 2
 | 
			
		||||
PubkeyAuthentication yes
 | 
			
		||||
AuthorizedKeysFile	.ssh/authorized_keys
 | 
			
		||||
PermitEmptyPasswords no
 | 
			
		||||
PasswordAuthentication no
 | 
			
		||||
ChallengeResponseAuthentication no
 | 
			
		||||
UsePAM yes
 | 
			
		||||
AllowAgentForwarding no
 | 
			
		||||
AllowTcpForwarding yes
 | 
			
		||||
X11Forwarding no
 | 
			
		||||
TCPKeepAlive yes
 | 
			
		||||
Compression no
 | 
			
		||||
ClientAliveCountMax 2
 | 
			
		||||
UseDNS no
 | 
			
		||||
PermitTunnel yes
 | 
			
		||||
PermitOpen localhost:27017
 | 
			
		||||
PrintMotd no
 | 
			
		||||
Subsystem	sftp	/usr/lib/openssh/sftp-server
 | 
			
		||||
		Reference in New Issue
	
	Block a user