4

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?

0

2 Answers 2

1

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.

0
1

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>... [email protected]
# 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.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .