diff --git a/src/ssh/sshd_start b/src/ssh/sshd_start index 78d48a9e..54f83490 100755 --- a/src/ssh/sshd_start +++ b/src/ssh/sshd_start @@ -21,6 +21,7 @@ if [[ "$SSH_ENABLE" == "1" ]]; then sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd echo "export VISIBLE=now" >> /etc/profile + echo -e "\n" >> $PG_HOME/.ssh/authorized_keys # ensure new line cat $PG_HOME/.ssh/id_rsa.pub >> $PG_HOME/.ssh/authorized_keys echo '>>> STARTING SSH SERVER...' diff --git a/tests/ssh-connect/run.sh b/tests/ssh-connect/run.sh index 8ded8022..891b2ab6 100755 --- a/tests/ssh-connect/run.sh +++ b/tests/ssh-connect/run.sh @@ -10,4 +10,11 @@ CHECKED_TEXT= if [[ "1" != `docker-compose exec pgmaster bash -c 'gosu postgres ssh -o LogLevel=QUIET -t pgslave1 "cat /tmp/ssh_check"' | grep SSH_CHECK | wc -l | tr -d ' '` ]]; then exit 1 -fi \ No newline at end of file +fi + +docker-compose restart pgslave +sleep 5 + +if [[ "1" != `docker-compose exec -T pgmaster bash -c 'gosu postgres ssh -o LogLevel=QUIET -t pgslave "cat /tmp/ssh_check"' | grep SSH_CHECK | wc -l | tr -d ' '` ]]; then + exit 1 +fi