diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-10-12 16:27:51 +0200 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2017-10-12 16:28:05 +0200 |
commit | 9fd633261e9e505e73022a01330420ec3e6b82dc (patch) | |
tree | 46e43d7a82a450034e3b01d5bd295688a8583170 /scripts | |
parent | a2effe5ecec057748e30050bd2d3bad6501a2aef (diff) |
Fix ssh credential copy where hostname cannot be resolved
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/xds-docker-create-container.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/xds-docker-create-container.sh b/scripts/xds-docker-create-container.sh index 2db3e5f..c9415ae 100755 --- a/scripts/xds-docker-create-container.sh +++ b/scripts/xds-docker-create-container.sh @@ -142,14 +142,14 @@ while [ $res -ne 0 ] && [ $count -le $max ]; do done echo -ssh-keygen -R [$(hostname)]:$SSH_PORT -f ~/.ssh/known_hosts +ssh-keygen -R [localhost]:$SSH_PORT -f ~/.ssh/known_hosts docker exec ${NAME} bash -c "mkdir -p /home/$DOCKER_USER/.ssh" docker cp ~/.ssh/id_rsa.pub ${NAME}:/home/$DOCKER_USER/.ssh/authorized_keys docker exec ${NAME} bash -c "chown $DOCKER_USER:$DOCKER_USER -R /home/$DOCKER_USER/.ssh ;chmod 0700 /home/$DOCKER_USER/.ssh; chmod 0600 /home/$DOCKER_USER/.ssh/*" -ssh -o StrictHostKeyChecking=no -p $SSH_PORT $DOCKER_USER@$(hostname) exit +ssh -o StrictHostKeyChecking=no -p $SSH_PORT $DOCKER_USER@localhost exit echo "You can now login using:" -echo " ssh -p $SSH_PORT $DOCKER_USER@$(hostname)" +echo " ssh -p $SSH_PORT $DOCKER_USER@localhost" ### User / Group id if ($UPDATE_UID); then |