In my pc I setup a file named ~/job/ssh/config
Host bitbucket
HostName bitbucket.org
IdentityFile ~/job/ssh/rsa_key
user git
IdentitiesOnly yes
and in my ~/.ssh/config
~/.ssh/config
Include /home/pcmagas/job/ssh/config
And the folder ~/job/ssh has the following settings:
-rw------- 1 pcmagas pcmagas 191 Σεπ 15 10:57 config
-rw------- 1 pcmagas pcmagas 3414 Σεπ 15 10:45 rsa_key
-rw------- 1 pcmagas pcmagas 761 Σεπ 15 10:45 rsa_key.pub
-rw------- 1 pcmagas pcmagas 419 Αυγ 28 15:32 work
-rw------- 1 pcmagas pcmagas 109 Αυγ 28 15:32 work.pub
By doing:
$ ssh bitbucket
PTY allocation request failed on channel 0
authenticated via ssh key.
You can use git to connect to Bitbucket. Shell access is disabled
Connection to bitbucket.org closed.
Also I can:
ssh -i ~/job/ssh/rsa_key [email protected]
PTY allocation request failed on channel 0
authenticated via ssh key.
You can use git to connect to Bitbucket. Shell access is disabled
I can connect to bithubket.
Firthermore by doing:
GIT_SSH_COMMAND='ssh -i ~/job/ssh/rsa_key -o IdentitiesOnly=yes' git clone [email protected]:exampe/myproj.git
I can clone it:
Γίνεται κλωνοποίηση μέσα στο 'myproj'...
remote: Enumerating objects: 210004, done.
fetch-pack: unexpected disconnect while reading sideband packet
But I cannot without the variable. Any ideas what's wrong?
As a means of mitigation I also tried to comment the inclide line in ~/.ssh/config and placing these stuff in to ~/.ssh/config directly:
Host bitbucket
HostName bitbucket.org
IdentityFile ~/job/ssh/rsa_key
user git
IdentitiesOnly yes
Furthermore I've run these commands as well:
chmod 400 ~/job/ssh/*
chmod +w ~/job/ssh/config
~/.ssh/) so it's not picked up byssh( andgitby extension) itself without you specifying it's path 2. You appear to not be running an instance ofssh-agentwith your key loaded 3. You could workaround the variable by usinggit config core.sshCommand.