Git push over SSH - User session has timed out idling after 600000 ms.


アトラシアン コミュニティをご利用ください。


プラットフォームについて: サーバーと Data Center のみ。この記事は、サーバーおよび Data Center プラットフォームのアトラシアン製品にのみ適用されます。



Sometimes pushing large changesets in a Git repository over SSH (common when doing the first push on a newly created repository) fails due to idling timeout.

The following appears in the git command output:

$ git push -u origin master
16:32:03.160072 git.c:350 trace: built-in: git 'push' '-u' 'origin' 'master'
16:32:03.222659 run-command.c:336       trace: run_command: 'ssh' '-p' '7999' 'git@' 'git-receive-pack '\''/tst/repository.git'\'''
Enter passphrase for key '/c/Users/username/.ssh/id_rsa':
16:32:11.773693 run-command.c:336       trace: run_command: 'pack-objects' '--all-progress-implied' '--revs' '--stdout' '--thin' '--delta-base-offset' '--progress'
16:32:11.873262 git.c:350               trace: built-in: git 'pack-objects' '--all-progress-implied' '--revs' '--stdout' '--thin' '--delta-base-offset' '--progress'
Counting objects: 22632, done.
Delta compression using up to 4 threads.
Received disconnect from 2: User session has timed out idling after 600000 ms.
Disconnected from
fatal: The remote end hung up unexpectedly
Compressing objects: 100% (21794/21794), done.
fatal: sha1 file '<stdout>' write error: Broken pipe
error: failed to push some refs to 'ssh://git@'


The reason for the failure is due to the fact that while pushing on Bitbucket the server needs to perform backgroud operations and the SSH connection will reamin idle for long time, hence causing the timeout.


Huge pushes are not common in the usual Git workflow, so it is better to avoid altering the Bitbucket server backend SSH configuration.

It is possible to tweak the configuration of the client workstation to modify the ServerAliveInterval for SSH connection.

ServerAliveInterval will send a null packet to the remote server every x seconds to keep the connection alive:

  1. Open the SSH config file (or crete it if it does not exist) on your client workstation:

    Windows instruction...

    Windows users can locate the file at:

    Linux instruction...

    Linux users can locate the file at:


  2. Add the following section to the file:

    Host *
         ServerAliveInterval 30
         ServerAliveCountMax 4
  3. Perform again the push operation.


最終更新日: 2016 年 10 月 4 日


Powered by Confluence and Scroll Viewport.