[Help] SSH into Python App in Docker

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Hey guys, I’ve been bashing my head on my keyboard trying to figure this out. I have a Python app that is using paramiko to run an SSH server that I can connect to. When running the app locally (using python3 main.py), I can connect to the app using ssh command inside of terminal or powershell. The issue I’m having now is being able to dockerize my app and get it working with SSH. I’ve been through tons of google searches trying to figure it out, but maybe someone here knows. Right now, I can start my docker container and am able to SSH but I get an error saying: kex_exchange_identification: read: Connection reset by peer Here is my Dockerfile: FROM python:3.8.2 COPY docker/requirements.text /requirements.tx RUN apt-get update -y && apt-get upgrade -y && apt-get install -y openssh-server RUN pip3 install –upgrade pip && pip3 install -r /requirements.txt ARG INSTALL_DIR=/opt/test ENV INSTALL_DIR_ENV=$INSTALL_DIR RUN mkdir -p $INSTALL_DIR COPY main.py $INSTALL_DIR COPY src $INSTALL_DIR/src RUN ssh-keygen -A RUN mkdir /var/run/sshd && chmod 755 -R /var/run/sshd && service ssh restart CMD python3 ${INSTALL_DIR_ENV}/main.py Any help is greatly appreciated, like I said, I am losing my brain trying to get this to work, I have no idea where to go with this and how to get it to work. Thank you so much! submitted by /u/Metiri [link] [comments]

X ITM Cloud News

Patricia

Leave a Reply

Next Post

Happy #SysAdminDay! Thank your senior sysadmins!

Sat Aug 1 , 2020
Spread the love           submitted by /u/datamattsson [link] [comments] X ITM Cloud News
X- ITM

Cloud Computing – Consultancy – Development – Hosting – APIs – Legacy Systems

X-ITM Technology helps our customers across the entire enterprise technology stack with differentiated industry solutions. We modernize IT, optimize data architectures, and make everything secure, scalable and orchestrated across public, private and hybrid clouds.

This image has an empty alt attribute; its file name is x-itmdc.jpg

The enterprise technology stack includes ITO; Cloud and Security Services; Applications and Industry IP; Data, Analytics and Engineering Services; and Advisory.

Watch an animation of  X-ITM‘s Enterprise Technology Stack

We combine years of experience running mission-critical systems with the latest digital innovations to deliver better business outcomes and new levels of performance, competitiveness and experiences for our customers and their stakeholders.

X-ITM invests in three key drivers of growth: People, Customers and Operational Execution.

The company’s global scale, talent and innovation platforms serve 6,000 private and public-sector clients in 70 countries.

X-ITM’s extensive partner network helps drive collaboration and leverage technology independence. The company has established more than 200 industry-leading global Partner Network relationships, including 15 strategic partners: Amazon Web Services, AT&T, Dell Technologies, Google Cloud, HCL, HP, HPE, IBM, Micro Focus, Microsoft, Oracle, PwC, SAP, ServiceNow and VMware

.

X ITM