Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

odd behavior exposing ssh login port? #54

Open
jeffsauer opened this issue Dec 30, 2022 · 2 comments
Open

odd behavior exposing ssh login port? #54

jeffsauer opened this issue Dec 30, 2022 · 2 comments

Comments

@jeffsauer
Copy link

using the buster lite image, I configured the ssh service to auto start with systemctl enable ssh.service

However, when trying to connect from a ssh client, I kept getting:

ssh -p 5022 pi@127.0.0.1
kex_exchange_identification: read: Connection reset by peer
Connection reset by 127.0.0.1 port 5022

The only way i could connect was by adding network_mode: host to my docker compose file, even though docker says published ports are ignored in host mode.

Here is my docker compose file:

dockerpi:
image: lukechilds/dockerpi:vm
container_name: dockerpi
command: pi3
environment:
- PUID=1000
- PGID=1000
- TZ=America/Phoenix
volumes:
- /home/jsauer/docker/appdata/dockerpi/buster_filesystem.img:/sdcard/filesystem.img
network_mode: host
ports:
- 5022:22/tcp
restart: unless-stopped

@robertsLando
Copy link

Got same problem even with newtork_mode it doesn't works

@robertsLando
Copy link

Seems the reason is ssh is not enabled by default, need to enable the service using sudo systemctl enable ssh once logged in. I think another way coud be edit the base image and add a .ssh file inside /boot partition.

No clue if there is an easier way to auto enable ssh on boot, no easy way to send commands to the vm from outside docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants