Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

HOST KEY VERIFICATION FAILED

mohan_b May 16, 2022
--add-host="host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL" \
bitbucketpipelines/scp-deploy:1.2.1
Unable to find image 'bitbucketpipelines/scp-deploy:1.2.1' locally
1.2.1: Pulling from bitbucketpipelines/scp-deploy
bb7d5a84853b: Pulling fs layer
f02b617c6a8c: Pulling fs layer
d32e17419b7e: Pulling fs layer
c9d2d81226a4: Pulling fs layer
3c24ae8b6604: Pulling fs layer
8a4322d1621d: Pulling fs layer
c9d2d81226a4: Waiting
a03ef301ddd7: Pulling fs layer
a4c591fc96f3: Pulling fs layer
c2fde97fe1fb: Pulling fs layer
8a4322d1621d: Waiting
02d081902850: Pulling fs layer
a03ef301ddd7: Waiting
a4c591fc96f3: Waiting
4e6a5cdfcfa7: Pulling fs layer
c2fde97fe1fb: Waiting
bad96da9f98d: Pulling fs layer
02d081902850: Waiting
1a9bd9b01ebe: Pulling fs layer
8d8633d00c54: Pulling fs layer
3c24ae8b6604: Waiting
4e6a5cdfcfa7: Waiting
1a9bd9b01ebe: Waiting
8d8633d00c54: Waiting
f02b617c6a8c: Verifying Checksum
f02b617c6a8c: Download complete
d32e17419b7e: Verifying Checksum
d32e17419b7e: Download complete
bb7d5a84853b: Verifying Checksum
bb7d5a84853b: Download complete
8a4322d1621d: Verifying Checksum
8a4322d1621d: Download complete
c9d2d81226a4: Verifying Checksum
c9d2d81226a4: Download complete
a03ef301ddd7: Verifying Checksum
a03ef301ddd7: Download complete
a4c591fc96f3: Download complete
c2fde97fe1fb: Verifying Checksum
c2fde97fe1fb: Download complete
bb7d5a84853b: Pull complete
02d081902850: Download complete
4e6a5cdfcfa7: Verifying Checksum
4e6a5cdfcfa7: Download complete
f02b617c6a8c: Pull complete
bad96da9f98d: Download complete
d32e17419b7e: Pull complete
3c24ae8b6604: Verifying Checksum
3c24ae8b6604: Download complete
1a9bd9b01ebe: Verifying Checksum
1a9bd9b01ebe: Download complete
8d8633d00c54: Verifying Checksum
8d8633d00c54: Download complete
c9d2d81226a4: Pull complete
3c24ae8b6604: Pull complete
8a4322d1621d: Pull complete
a03ef301ddd7: Pull complete
a4c591fc96f3: Pull complete
c2fde97fe1fb: Pull complete
02d081902850: Pull complete
4e6a5cdfcfa7: Pull complete
bad96da9f98d: Pull complete
1a9bd9b01ebe: Pull complete
8d8633d00c54: Pull complete
Digest: sha256:b9111f61b5824ca7ed1cb63689a6da55ca6d6e8985eb778c36a5dfc2ffe776a8
Status: Downloaded newer image for bitbucketpipelines/scp-deploy:1.2.1
DEBUG: Starting new HTTPS connection (1): bitbucket.org:443
DEBUG: https://bitbucket.org:443 "GET /bitbucketpipelines/official-pipes/raw/master/pipes.prod.json HTTP/1.1" 200 None
INFO: Using passed SSH_KEY...
INFO: Adding known hosts...
INFO: Appending to ssh config file private key path
INFO: Applied file permissions to ssh directory.
Executing: program /usr/bin/ssh host x.xxx.xx.xx, user ubuntu, command scp -v -r -p -d -t /home/ubuntu/pipeline/
OpenSSH_8.4p1 Debian-5, OpenSSL 1.1.1k 25 Mar 2021
debug1: Reading configuration data /root/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to x.xxx.xx.xx [x.xxx.xx.xx] port 22.
debug1: Connection established.
debug1: identity file /root/.ssh/pipelines_id type -1
debug1: identity file /root/.ssh/pipelines_id-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.4p1 Debian-5
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.2p1 Ubuntu-4ubuntu0.2
debug1: match: OpenSSH_8.2p1 Ubuntu-4ubuntu0.2 pat OpenSSH* compat 0x04000000
debug1: Authenticating to x.xxx.xx.xx:22 as 'ubuntu'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:xVqWItEasJmMP8WKRHdxRdOI4ZooV9gWyjhNmDZzGMA
debug1: read_passphrase: can't open /dev/tty: No such device or address
Host key verification failed.
lost connection
✖ Deployment failed.

2 answers

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 16, 2022

This is usually caused by the unix user you are logging in as not having a valid shell. or ssh settings.

The "can't open /dev/tty" bit near the end is the giveaway.  Try logging in manually, you will probably get the same error. 

If you do, then you will need to log in as another user (one who can use su or sudo to change other user's accounts), and look at why that user cannot log in (make sure they have a shell and home directory set in /etc/passwd, and that their home directory exists, belongs to them and they can read/write it).  Try "su - <username>" first to see what that does. it might tell you more about what the problem is

If you can log in, or you've fixed the account as above, then you'll want to check what is in the .ssh directory in their home directory. 

mohan_b May 16, 2022

I am able to login from my local system with same user 

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 17, 2022

So, from your system, you can use "ssh ubuntu@x.xxx.xx.xx" and get a command prompt?

What is in that user's .ssh directory in their home directory?

mohan_b May 18, 2022

yes,

 

I have resolve my issue by following 

https://www.basictechno.com/pipeline-bitbucket-to-aws-ec2-over-ssh/

 

thanks for helping

0 votes
mohan_b May 16, 2022
THIS IS YML FILE
pipelines:
branches:
development:
- step:
name: Installation
caches:
- node
script:
- npm install
- step:
name: PRINT PEM
script:
- pipe: atlassian/scp-deploy:1.2.1
variables:
USER: 'ubuntu'
SERVER: 'x.xxx.xx.xx'
REMOTE_PATH: '/home/ubuntu/pipeline/'
LOCAL_PATH: '${BITBUCKET_CLONE_DIR}/*'
SSH_KEY: $key
DEBUG: 'true'
EXTRA_ARGS: ['-o', 'ServerAliveInterval=10']

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events