Permission Denied on bzr info lp:bzr - bazaar

I have added my SSH Public and Private keys. But I'm still getting Permission Denied on "bzr info lp:bzr"
What am I missing? I've attached a screenshot of my Launchpad, Pageant, and the Console.

This happens when:
You told Bazaar your Launchpad username with bzr lp-login USERNAME
... but, Bazaar could not verify it (your access to USERNAME on Launchpad)
You can see your Launchpad username configuration with the command:
$ bzr config
bazaar:
[DEFAULT]
launchpad_username = the-username-you-set-with-bzr-lp-login
You can either fix your ssh key setup (see this discussion), or you can remove the launchpad_username setting with:
bzr config --remove launchpad_username --scope=bazaar
After this bzr info lp:bzr should work, unless you have other issues (for example with proxy server, network, firewalls, or others).

Related

dokku - giving another user root access

I added another user's public ssh-key to my dokku server, but they can't login using ssh root#appname.com.
I can see their ssh-key in authorized_keys and also if I run sshcommand list dokku or sshcommand list root.
I have checked in the sudoers config, and it seems that all ssh-keys are given root permissions:
$ cat sudoers
/...
# User privilege specification
root ALL=(ALL:ALL) ALL
I am using the dokku-acl plugin, but haven't found anything in the docs that would help.
The server is an Aliyun ECS (China).
Feel like I am missing something simple. Any advice is very much appreciated!
root ssh access and dokku ssh access are governed separately. The user's public key should be added as is to the /root/.ssh/authorized_keys file, whereas the /home/dokku/.ssh/authorized_keys file should only be managed by the subcommands of the ssh-keys plugin (included with Dokku).
You may wish to remove the entries from both files manually, then add the entries back as described above. For dokku user access - which would grant the ability to push code as well as perform remote commands via ssh dokku#host $command - you can use the command dokku ssh-keys:add to add a specific user:
echo "PUBLIC_KEY_CONTENTS" | dokku ssh-keys:add some-user-name

Microsoft TFS ssh cloning fails

I am trying to clone a repo from a project on my Team Foundation Server domain. I have created an SSH key under my profile security. However after accepting the repo's key I am still requested to sign in with a password and the authentication fails:
git clone ssh://mydomain#mydomain.visualstudio.com:22/Project/_git/project-repo
Cloning into 'project-repo'...
mydomain#mydomain.visualstudio.com's password:
Permission denied, please try again.
mydomain#mydomain.visualstudio.com's password:
Permission denied, please try again.
mydomain#mydomain.visualstudio.com's password:
Permission denied (password,publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I have tried both my visualstudio.com password and SHH key password none of which work.But Why is it asking me for a password?
The prerequisite to use ssh for VSTS as below:
Generate ssh key. In git bash, use ssh-kengen in git bash -> select path to save the key -> enter passphrase (if you don’t want passphrase, press enter direcly).
Add the content of .ssh/id_rsa.pub file in KeyData in VSTS SSH public keys (profile -> security).
For your situation, it seems the conent of .ssh/id_rsa.pub is not same with VSTS SSH public keys. So you'd better do step1 and setp2 above and ten clone again with ssh protocol.
The way I resolved this was by deleting and recreating my id_rsa.pub without a password.
The default authentication mode when using SSH is the private key. Whenever that fails for some reason, the ssh-agent falls back to username and password based authentication.
There are several reasons why the default key based authentication might have failed. Following are the most common cases :
a) The ssh-agent cannot find the default private key file which is id_rsa, and no other key path is specified explicitly.
b) The public key stored in the server is incorrect.
c) The path you're trying to clone is incorrect.
In any case, to troubleshoot the issue first of all execute the git clone command with verbose logging with the command :
GIT_TRACE=1 GIT_SSH_COMMAND="ssh -vvv" git clone ssh://pathToYourRepo
You can go through each step in the log to get an intuition of what the issue might be.
Troubleshooting in case of (a)
Make sure you have the default key name id_rsa in the .ssh directory. You might have specified some different keyname when generating the key with ssh-keygen command or maybe there isn't any key at all).
In case you want to specify a different key for authentication, use the following command :
ssh-agent bash -c 'ssh-add ~/.ssh/anotherKey; git clone ssh://pathToYourRepo'
Troubleshooting in case of (b)
Make sure there aren't extra white spaces when storing the public key in the server.
Troubleshooting in case of (c)
Make sure you aren't trying to clone with the https version of the repository path.

After the upgrade to TortoiseGit v1.8.15.0 and Git v2.5.0 hosts cannot be found

I've just updated my TortoiseGit from v1.7.* to v1.8.15.0 and Git from 1.* to v2.5.0.windows.1. Now trying to perform a remote operation like pull I'm getting errors:
git.exe pull -v --progress "origin"
Unable to open connection: Host does not existfatal: Could not read
from remote repository.
Please make sure you have the correct access rights and the repository
exists.
git did not exit cleanly (exit code 1) (1747 ms # 19.08.2015 18:43:33)
I changed the SSH client setting from TortoiseGitPlink to PuTTY. It didn't work as well, but the PuTTY Error provided following information:
Unuble to open connection to github.com-foo
Host does not exist
I work with aliases and my ~/.ssh/config looks like this:
#github.com-foo account
Host github.com-foo
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_foo
#github.com-bar account
Host github.com-bar
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_bar
That worked before the upgrade and is still working in msys.
TortoiseGit seems to ignore the config. How to make TortoiseGit respect the config again?
PuTTY and TortoiseGitPlink do not respect .ssh/config (as described in e.g. Multiple GitHub Accounts & SSH Config or https://gist.github.com/jexchan/2351996). Both tools store, like Windows tools, their configuration in registry.
For using PuTTY in your scenario, please see the TortoiseGit Manual - Tips and tricks for SSH/PuTTY.
PS: .ssh/config is the config file for OpenSSH. If you want to use OpenSSH, set the ssh client to ssh.exe in TortoiseGit network settings (there is no need to use the full path to ssh.exe as it is on the %PATH%):

ssh -T git#github.com Permission denied (publickey)

I tried to push my blog (Octopress) to github and got this error:
MacBook-Air:octopress bdeely$ git push origin source
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I generated an SSH key, saved it, and even linked it with my GitHub account in the SSH key settings, but I went ahead and checked the status and got the same error:
MacBook-Air:.ssh bdeely$ ssh -T git#github.com
Permission denied (publickey).
In addition to this, I checked github's help page, did the following and got this error message:
MacBook-Air:~ bdeely$ ssh-add -l
The agent has no identities.
Does anyone know what is wrong and how I can fix this?
On OSX, if you type
ssh-add -l
and you get back "no identities", that means your ssh agent does not have any identities loaded into it. Oftentimes, when the mac reboots, you have no identities.
I add mine back after a re-boot by explicitly running
ssh-add
This loads a default identity from ~/.ssh/id_rsa
You can also use the ssh-add command with a specific identity
ssh-add ~/foo/bar/is_rsa
After you add your identies, you can seem them all listed by typing
ssh-add -l
Make sure you have at least one listed.
Follow the commands:
mkdir ~/.ssh //in case that the folder doesnt exist...
cd ~/.ssh
ssh-keygen -t rsa -C "youremail#somewhere.gr"
#hit enter when asks for file to save the key.
#enter the passphrase
At last copy the id_rsa.pub into your github account.
Try this in your terminal:
eval `ssh-agent -s`
ssh-add ~/.ssh/id_rsa
enter your passphrase if any and it should work. Hope this helps :-)
I hope this helps you:
I was having the identical problem and about to take my own eyes out with insane frustration; nothing online led me to an answer and I was trying to use the git push command without specifying the URL exactly (which could also solve the problem I believe), so I didn't see how the connection was failing.
I had set up my .ssh/config correctly for two users with two different keys, even using IdentitiesOnly yes which is supposed to override ssh-agent that was automatically supplying the WRONG ssh identity.
I finally realized the problem as I examined the local repository configuration - it was the entry
[remote "origin"]
url = git#github.com:{my-username}/{my-repo-name}.git
My configuration in .ssh/config file was using the same HostName github.com entry for both users and I'm completely new to all this so I didn't realize that to correctly override ssh-agent, I had to specify the exact URL or else the specific identities in my .ssh/config file would be ignored and the first key that ssy-agent listed (which was the wrong one my my case) would be used by default.
I fixed this by changing the local repo URL to url = git#github-personal:{my-username}/{my-repo-name}.git, where I had set Host github-personal as the identity in my .ssh/config.
Another way to solve this would be specifying the user in the URL in the git push command itself, or even better, a solution described here in a post AFTER solving this my own crappy way:
https://superuser.com/questions/272465/using-multiple-ssh-public-keys
I can't believe that no official source could offer a solution for or even properly explain this edge-case that seems really common (accessing two different github accounts from one machine with SSL).
I experienced the same problem. The reason was that I moved the key-files to another folder; it worked successfully when I moved them back to where they were originally.

Push to Gitlab returns fatal

Using a fresh Gitlab install, generated and added SSH keys to the user account, created a new project.
From a local machine, created one (1) folder, added a readme and preformed the following from the terminal:
git init
git add README
git commit -m '1_16_2013'
git remote add origin git#192.168.1.55:root/test.git
git push -v origin master
The push asks for the git#192.168.1.55's password and returns:
Connection closed by 192.168.1.55
fatal: The remote end hung up unexpectedly
Do I need to add a shh key to my local machine?
You need to have the public and private keys (id_rsa and id_rda.pub) stored on your ~/.ssh directory of your local machine.
Otherwise, any ssh to the gitlab server will ask for a password.
You also need to use the right ssh address:
git#192.168.1.55:test.git
You shouldn't have any path in front of the name of the git repo: gitolite (used by GitLab) will detect the name of the repo and will use the right repo path.
I prefer storing this information (server name, ssh user, private key...) in a ~/.ssh/config file: see "gitolite: can connect via ssh, can't clone" as an example (or "git clone git#myserver:gitolite-admin fails").