bitbucket on aws - ssh fails with error: "shell request failed on channel 0"

Trolled the web, cant seem to find a solution. 

Setup: 

Bitbucket installed on AWS using the Bitbucket ami. I've setup the ssh keys.

The problem:

Testing ssh access (ssh -T ...) fails after authentication with the error: shell request failed on channel 0".

How / what:

Here's the command I run from gitbash on my Windows 7 PC. I've also tried with the option (-o ForwardX11=no), and same results: 

$ ssh -T -v git@my.awshost.com -p 7999

Here's the output on the Windows PC:

OpenSSH_7.1p2, OpenSSL 1.0.2d 9 Jul 2015

debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to my.awshost.com [52.204.172.23] port 7999.
debug1: Connection established.
debug1: identity file /c/Users/user1/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/user1/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/user1/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/user1/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/user1/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/user1/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/user1/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/user1/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
debug1: Remote protocol version 2.0, remote software version SSHD-CORE-0.14.1-ATLASSIAN-01
debug1: no match: SSHD-CORE-0.14.1-ATLASSIAN-01
debug1: Authenticating to my.awshost.com:7999 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha2-256 none
debug1: kex: client->server aes128-ctr hmac-sha2-256 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
debug1: Host '[my.awshost.com]:7999' is known and matches the RSA host key.
debug1: Found key in /c/Users/user1/.ssh/known_hosts:1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /c/Users/user1/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to my.awshost.com ([52.204.172.23]:7999).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
shell request failed on channel 0

 

 

1 answer

0 vote

Hi @Sreeram Ramanathan,

Bitbucket Server's SSH built-in SSH server does not allow interactive SSH sessions. If you want to log into your Amazon EC2 instance, you will need to connect via port 22, and use the AWS EC2 Key Pair you specified when creating the instance.

The SSH server running on port 7999 will only accept certain whitelisted commands to allow interacting with the SCM via SSH. 

Any git command should work. Ie. you should be able to git clone via SSH from Bitbucket Server. 

I hope that helps, 

Felix 

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

23,370 views 26 12
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you