I saw this issue when I access bitbucket in corporate network, while git works fine in home network.
$ git pull
ssh: connect to host bitbucket.org port 22: Bad file number
fatal: Could not read from remote repository.
I used https protocol to workaround this.
$ git pull https://[email protected]/myaccount/myrepo.git
Password for 'https://[email protected]':
Please use corresponding words to replace "myaccount" and "myrepo".