Sign inSign up

bleonard252/alpine-ssh

By bleonard252

•Updated about 7 years ago

Alpine-based image that permits attaching using a shell. It's for Portainer.

Image
0

185

bleonard252/alpine-ssh repository overview

Source: my gist⁠.

To use:

  1. Pull using docker pull bleonard252/alpine-ssh
  2. Create a container, i.e. docker run --name ssh --privileged --network=host -e SSHUSER=username bleonard252/alpine-ssh
  3. Attach to it using Portainer's Attach to Container Shell feature, enter your password if necessary, and go!

Things you need to know:

  • You can also use "exec" (with /bin/sh) and run ssh-keygen and ssh-copy-id username@localhost to access the SSH server by public key.
  • Three environment variables exist: SSHUSER for the username (also, if you're daring, the password in the form of username:password), SSHHOST for the hostname (localhost by default), and SSHPORT (22 by default).
  • The only environment variable you really need to change is SSHUSER, unless the device or port is different than the one alpine-ssh is being run on, then change those.
  • --network=host is required so that localhost works correctly.
  • This image is made for Portainer, but if you have a similar interface you can use that.
  • This image is compiled for ARM Linux (specifically Raspbian), but if you build it for another platform, let me know and I'll list it here.

Tag summary

Content type

Image

Digest

Size

5.6 MB

Last updated

about 7 years ago

docker pull bleonard252/alpine-ssh