Closed ChexWarrior closed 5 years ago
Which $PHP_TAG
do you use?
This line looks strange, because authorized_keys
could contain more then 1 key:
/Users/${whoami}/.ssh/id_rsa.pub:/home/wodby/.ssh/authorized_keys
What is the output of ls -la ~/.ssh
in the ssh container?
I am still unable to ssh into the container (it times out).
It likely, the issue caused by a network - not by SSH keys.
Which $PHP_TAG do you use?
7.2-dev-4.10.0
This line looks strange, because authorized_keys could contain more then 1 key
That's okay, it just needs to contain my public key so I can ssh from the host into the container.
What is the output of ls -la ~/.ssh in the ssh container?
wodby@php.container:/var/www/html $ ls -la ~/.ssh total 20 drwxr-xr-x 1 wodby wodby 4096 Jan 23 13:17 . drwxr-sr-x 1 wodby wodby 4096 Jan 23 13:17 .. -rw------- 1 wodby wodby 397 Jul 7 2015 authorized_keys -rw-r--r-- 1 wodby wodby 1643 Jan 23 13:17 config -rw-r--r-- 1 wodby wodby 1146 Jan 23 13:17 environment
Contents of the ~/.ssh/config
file:
# Site-wide defaults for some commonly used options. For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.
# Host *
# ForwardAgent no
# ForwardX11 no
# RhostsRSAAuthentication no
# RSAAuthentication yes
# PasswordAuthentication yes
# HostbasedAuthentication no
# GSSAPIAuthentication no
# GSSAPIDelegateCredentials no
# BatchMode no
# CheckHostIP yes
# AddressFamily any
# ConnectTimeout 0
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/identity
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
# IdentityFile ~/.ssh/id_ecdsa
# IdentityFile ~/.ssh/id_ed25519
# Port 22
# Protocol 2
# Cipher 3des
# Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
# MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
# EscapeChar ~
# Tunnel no
# TunnelDevice any:any
# PermitLocalCommand no
# VisualHostKey no
# ProxyCommand ssh -q -W %h:%p gateway.example.com
# RekeyLimit 1G 1h
Contents of the ~/.ssh/environment
file:
CONF_DIR=/var/www/conf
DB_HOST=mariadb
HOSTNAME=bf5f5e14baf8
PHP_DEBUG=
SSHD_PERMIT_USER_ENV=yes
SSHD_HOST_KEYS_DIR=/etc/ssh
PHPIZE_DEPS=autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c
GPG_KEYS=1729F83938DA44E27BA0F4D3DBDB397470D12172 B1B44D8F021E4E2D6021E995DC9FF8D3EE5AF27F
DB_USER=wordpress
PHP_EXTRA_CONFIGURE_ARGS=--enable-fpm --with-fpm-user
PHP_ASC_URL=https://secure.php.net/get/php-7.2.13.tar.xz.asc/from/this/mirror
PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2
ENV=/home/wodby/.shrc
WP_VER=5.0.3
PHP_DEV=
PHP_LDFLAGS=-Wl,-O1 -Wl,--hash-style
DB_PASSWORD=wordpress
PHP_SENDMAIL_PATH=/usr/sbin/sendmail -t -i -S mailhog:1025
GIT_USER_EMAIL=wodby@example.com
GOTPL_VER=0.1.5
PHP_INI_DIR=/usr/local/etc/php
PHP_URL=https://secure.php.net/get/php-7.2.13.tar.xz/from/this/mirror
PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2
GIT_USER_NAME=wodby
APP_NAME=WordPress 4
FILES_DIR=/mnt/files
PHP_VERSION=7.2.13
DB_NAME=wordpress
APP_ROOT=/var/www/html
PHP_MD5=
PHP_SHA256=14b0429abdb46b65c843e5882c9a8c46b31dfbf279c747293b8ab950c2644a4b
LD_PRELOAD=/usr/lib/preloadable_libiconv.so php
_=/bin/printenv
It likely, the issue caused by a network - not by SSH keys.
Can you elaborate on what you mean? I think the authorized_keys
is fine, however I suspect that sshd
within the container doesn't have the proper settings required for me to ssh in from the host.
Do you need to SSH from your local container to a remote server? You don't SSHD for this, just mount your private SSH key to php container and set $SSH_DISABLE_STRICT_KEY_CHECKING=1
(to avoid interactive dialogue) as we do in tests
Do you need to SSH from your local container to a remote server?
No, I want to ssh from my host machine into the local container, I'm testing a PHP script that involves sshing into containers and I'd like to set up some proper tests before running this on any remote servers.
Hey guys,
I have been working on a script that needs to ssh into our staging and production Wodby instances. To properly test this script I have been attempting to create a local build that I can ssh into from my host machine. I have followed the instructions given in this repo's README for enabling SSH, however even after updating this image's command to be ssh and mounting a public key I am still unable to ssh into the container (it times out).
When I check the
~/home/.wodby/.ssh/environment
file on the local build I notice it is lacking a lot of the options included in that same file on the staging and production environments so I assume that is the reason ssh doesn't work. Can you help me get this working on my local environment?The local build I am using is docker4wordpress, I've modified the
docker-compose.yml
like so to enable SSH (see the ssh service):The
wodby-ssh
image was created by modifying the CMD line of the wodby-phpDockerfile
like so:Note: I had a previous discussion with @PavelPrischepa over Intercom earlier and he asked me to create this issue.