Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Even though the login shell of user 'git' is /bin/bash, when I try to ssh to the machine I get the following error:

PTY allocation request failed on channel 0
bash: /home/git/bin/gitolite-shell: No such file or directory
Connection to closed.

I do 'deluser git', then 'adduser git --shell=/bin/bash', but it does not work. I change it again with 'chsh', still does not work. Where is this '/home/git/bin/gitolite-shell' stored?

share|improve this question

I just figured it out that when I completely reset the whole home directory of the git user:

deluser git --remove-home --backup # creates backup of home dir of git. see deluser(8)
adduser git

I got rid of gitolite-shell.

However I still don't know where string /home/git/bin/gitolite-shell is stored.

share|improve this answer

Unless you installed it, it won't be on your system. The reason you are getting the error is, I believe, the following:

You are connecting with a particular key that is recognized in the file of ~git/.ssh/authorized_keys. In there you might have found an entry like this:

# gitolite start 
command="/home/git/bin/gitolite-shell YOURNAME",no-port-forwarding,
ssh-rsa AAAAB3N.....<snip>...
# gitolite end

So instead of honouring your settings of the default shell that you set using chsh, the sshd interferes and starts a particular program (in this case gitolite-shell). It is part of the cunning gitolite setup and desired behaviour. In your setup you were missing gitolite or maybe just the appropriate link in ~git/bin to it. Unfortunately, you won't be able to verify this now.

If you do want to try it, you might choose to install from the up-to-date repository (instructions here) since the ubuntu version 2.2 is behind the official v.3.4.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.