Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Keep running into problems when setting up on a new laptop

Will Willer March 22, 2019

I'm not well versed with bitbucket or git, my python professor had me use it with wsl for our class, and I've found it pretty handy for keeping all my computers up to date for the past year or so.

When I try to generate an ssh key (I can't just clone for some reason), it creates the rsa file, the public rsa file, and a file named known_hosts. I'm probably wrong about this, but I don't remember it creating that third file on my other computers. I went ahead and skipped the part where I add the key to the ssh agent just because I ran into problems trying to get that set up, but I'm okay with having to enter my password as long as it works, so let's not bother with that.

I'm able to copy the contents of the public file and hit save, but when I type ssh -T git@bitbucket.org, I get the message:

setsockopt IPV6_TCLASS 8: Operation not permitted:
authenticated via a deploy key.


You can use git or hg to connect to Bitbucket. Shell access is disabled.

This deploy key has read access to the following repositories:  
nihil/cs2: default -- 

 I can git clone the repository and it'll actually create it on my computer, and I can add and commit changes, but pushing them gives me the error "access via a deployment key is read-only."

I never really got an explanation on how this whole thing worked, he just gave us a poorly-made tutorial on how to get it set up. I'd really appreciate some help

1 answer

0 votes
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 22, 2019

Hi Will,

Welcome to the Atlassian Community.

In order to use SSH with Bitbucket Cloud you have to have an access key added to the repository that allows you to authenticate.

Regarding the known_hosts file, it contains the fingerprint of the host and SSH is using that to identify the host. If the fingerprint is not in the known_hosts file, you will get a question if you want to add it or not.

Will Willer March 22, 2019

That's the problem that I'm running into. The setup goes smoothly until the part where we enter "eval 'ssh-agent'." Instead of getting just the "agent pid ####",  I get this:

nihil@MSI:/mnt/c/users/willw/documents/Repositories/cs2$ eval 'ssh-agent'
SSH_AUTH_SOCK=/tmp/ssh-ZS61AWA7YuPA/agent.106; export SSH_AUTH_SOCK;
SSH_AGENT_PID=107; export SSH_AGENT_PID;
echo Agent pid 107;

 if I keep moving past that irregularity, next we type in ssh-add ~/.ssh/id_rsa, and that gives me:

nihil@MSI:/mnt/c/users/willw/documents/Repositories/cs2$ ssh-add ~/.ssh/id_rsa
Could not open a connection to your authentication agent.

As I said before, I skipped that part because I'm fine with entering my password each time as long as it works.  I moved ahead and was able to cat the contents,paste the key into bitbucket, and actually move the files onto my pc, but I can't push when I make updates.

I might be messing up with the "ssh-add ~/.ssh/<private-key-file>. That is id_rsa, right? And since I am using wsl on my laptop, I should be following the linux walkthrough, right? Thanks for replying so fast earlier

Will Willer March 22, 2019

Also, can I use the key for all my repositories?

Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 25, 2019

Yes, the access key and your ssh key can be used for all your repositories.

The error you get indicate that ssh-add do not know how to talk to the authentication agent, which is set when you run eval ssh-agent. You can try and run:

eval $(ssh-agent)

or

ssh-agent bash

Hopefully that will help. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events