jeroenpeeters/docker-ssh

SSH locks up when trying to execute bash command

johnennewdeeson opened this issue · 1 comments

Hi, I'm trying to login with the following command which should open an interactive terminal but it just causes the terminal to completely lock up

ssh -p2223 -t localhost 'cd docroot; bash -l'

I'm running a Drupal website and this is a fairly standard command executed by its command line tool to give you a command. I'm running docker and docker compose on a Mac.

My docker compose config looks like this:

  ssh:
    image: jeroenpeeters/docker-ssh
    environment:
      AUTH_MECHANISM: noAuth
      CONTAINER: php_1
      HTTP_ENABLED: 'false'
    ports:
      # Use local port 2223 for SSH connections.
      - '2223:22'
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

This command works fine and gives me a shell which I can then type the commands in manually. Just wondering why the top command doesn't work.

ssh -p2223 -t localhost

I can confirm this. SSH locks totally.

If I do ssh -p2223 -t localhost bash -c "pwd", it works