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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Can't deploy sftp to production with change port Edited

I have a bitbucket account. I'm trying to build pipelines using sftp deploy, the problem comes when I change my ssh port. When I commit, the output deployment fails.


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: WgnXplwkwYNXMVdzcKpILAlYZJ43Y7mm / qMNdHyZ7Fk
debug1: checking without port identifier
Host key verification failed.
Connection closed
Connection closed.
+ STATUS = 255
+ set -e
+ [[255 == \ 0]]
+ file 'Deployment failed.'
+ echo -e '\ e [31m✖ Deployment failed. \ e [0m'
+ exit 255
✖ Deployment failed.

This is my bitbucket-pipelines.yml config.
image: python: 3.7.3

pipelines:
  default:
    - step:
        name: Build and test
        caches:
          - pip
        script:
          - pip install - upgrade pip
          - git clone git@bitbucket.org: linuxteknosia / codeku.git
        artifacts:
          - my code / **
    - step:
        name: Deploy artifacts using SFTP to PROD
        deployment: production
        script:
          - pipe: atlassian / sftp-deploy: 0.5.0
            variables:
              USER: $ USER
              SERVER: $ SERVER
              SSH_KEY: $ SSH_KEY
              REMOTE_PATH: '/ var / www / html'
              LOCAL_PATH: 'my code / *'
              DEBUG: 'true'
              EXTRA_ARGS: '-P 999'

Strangely, when the ssh port uses port 22, the config is successfully committed to the server. Can you help where the fault lies?

1 answer

Hi @linuxteknosia , try adding your host:port to the list of known hosts in pipelines settings, as described here https://community.atlassian.com/t5/Bitbucket-questions/Use-non-22-SSH-port-in-pipelines/qaq-p/585622 . 

Go to the Repository settings > Pipelines > SSH Keys , enter the host:port into the 'Host address' field under the Known hosts section and click Fetch. This should add and known_hosts entry with a specific port number.

If the above steps don't help, try removing all entries from known hosts settings and add fresh fingerprints instead.

Right, thank you

i'm having same issue. put host:port gets the fingerprint and i can add the host. but the pipeline process don't work, i got "Host key verification failed". if i put just the host without port, the fingerprint is not found.

remove entries from known hosts and add again, doesn't help

any ideas?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,217 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you