Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 192.168.20.151 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

2 Answers 2

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,
no-X11-forwarding,no-agent-forwarding,no-pty 
ssh-rsa AAAAB3N.....<snip>... YOURNAME@whereever.the.ssh.key.came.from.com
# 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

 
discard

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.