How to Remove Keys from SourceTree SSH Agent - windows-10

I am using SourceTree on Windows. I have SSH keys to validate the server connection. So, when I start Sourcetree it launches the SSH Agent which then asks me for the passwords for each key. That is fine.
However, while I can see an option in SourceTree to "Add SSH Key" I cannot see how to remove one. My actual problem is that, due to a misleading error message, I re-added the key and it now has the same key multiple times and asks for too many passwords at start-up! But, more generally, i would like to be able to list and remove keys from the SSH agent.
I have tried using command line ssh-add but it says
Error connecting to agent: No such file or directory
(Tried this both with windows CMD shell and in the Git bash terminal that SourceTree launches)
I see a running ssh-agent.exe process in Task Manager when SourceTree is running - in the Details tab. But in the Services tab it says the service is stopped. So, I guess SourceTree has started it but how do I connect to it? Alternatively, how to tell SourceTree not to start it's own but use the Windows Service?
I am using the OpenSSH SSH client (in SourceTree options)

Finally found my own answer. There doesn't appear to be a way to connect to the agent directly, but the keys are stored directly in the SourceTree config. Tools | Options | General | SSH Client Configuration : SSH Key. This field is a semi-colon separated list of paths to the keys to load. I just removed the duplicates from there.
Now have issues getting SourceTree and OpenSSH Agent to co-exist, but that's a different question. At least it only asks me for each password once.

Related

Android studio SSL certificate problem: unable to get local issuer certificate (LONGTERM SOLUTION)

I know this is known issue. I am trying to do the git pull in my android studio with current project and I get this warning. So I generated my key on macbook with command:
ssh-keygen -t rsa
than I copy it and added to bitbucket profile in ssh keys. Also I added certificate to the android studio settings (tools -> server certificates).
Still I get this issue. I tried with changing git.config but also without success.
with command:
git config --global http.sslVerify false
it works well, but I don't want solutions like this since it is bad and not secure.
Does anyone has any good suggestion. Thanks!
After long time spent I found the solution. This can be very helpful so try it out if you have same problem.
Situation was that in my android studio I added HTTPS URL (e.g., https://bitbucket.org/username/repo.git) instead of SSH URL (e.g., git#bitbucket.org:username/repo.git). You can change this in Git -> Manage remotes. Copy the SSH URL from bitbucket (or any other VCS by clicking on clone option and selecting ssh instead of https)
So Even though everything is set up well, SSL protocol (used to transfer securely data) is unable to connect (in these situations SSH protocol is used. It allows executing commands, not only sending data like SSL. It is usually used for log in situations like this)
Hope this helps, have a good day coding.

What means terminal prompts disabled?

I use gitlab since some years.
After an update of my mac book, one application fails on deploy with deployer.
fatal: could not read Username for 'http://mygitlab.org:22': terminal prompts disabled
I use the same gitlab server for all projects. The other projects are working well.
I compared the gig config file. No differences between the applications.
I tried to set/change the username. No success
I created a new repo on gitlab, and cloned it into my php storm. No success
Has someone an idea, where i have to search?
Thanks in advance!
Check the URL of that repository. A port 22 is the default one used by SSH, so seeing an HTTP URL used is strange, and would trigger a prompt for the username.
This differs from a git#mygitlab.org: URL (or ssh://git#mygitlab.org:22/...), which should not need any prompt, if the right SSH key is used (and has no passphrase, or if the passphrase is cached in an ssh-agent).

Default Jenkins User Password

I have a fresh install of Jenkins as a service on my Linux machine. When Jenkins installs, it creates a 'jenkins' user, but I can't seem to find the default password for it anywhere.
I'm trying to secure my system, so if the default password is '123' or something insecure that I just haven't thought of yet, that's a problem.
Thanks!
I don't believe it has any password. You should be able to do:
sudo passwd jenkins
This will prompt for you to set a password.
Alternatively you could create the jenkins user prior to installing, and it would leverage that one.
For fedora,
Go to /root/.jenkins/
open config.xml
In config.xml, set disableSignup to false.
Restart Jenkins.
Go to the Jenkins web page and sign up with a new user.
In config.xml, duplicate one of the hudson.model.Hudson.Administer:username lines and replace username with the new user.
If it's a private server, set disableSignup back to true in config.xml.
Restart Jenkins.
Go to the Jenkins web page and log in as the new user.
Reset the password of the original user.
Log in as the original user.
Default password for user jenkins is just "jenkins". However, logging into this user automatically closes your session (probably it is set to be used only to allow using particular computer as a jenkins agent, but I'm not sure). That't why su - jenkins and typing jenkins do not work.
You can try logging as a jenkins user with ssh and you will see that it works, but suddenly the session is closed:
I believe there is a solution for this, but maybe it is not needed in your case. Really need to use system as a jenkins user? Doubt it.
C:\Windows\system32\config\systemprofile.jenkins\secrets\
goto above mentioned path and find
"initialAdminPassword" click that file and copy value
this is password for jenkins!

using the ssh keys on other machine for remote login

I have started using ssh keys login for my new VPS. It works on the work machine as i have placed the public key on the server using this ssh-copy-id command.
Successfully, i was able to login without password from my work machine.
Now for checking the security, i tried logging in from some other machine that didn't had the private key installed. I wasn't able to login and that was perfect.
Now i do work from home as well. I want to know the method for taking the private key from my office pc and placing it in my home pc so that i am able to login from there as well without generating a second key.
I am on ubuntu 12.0 LTS on both home and work pcs.
EDIT
Further, is it the case that once i start using ssh keys for authentication on a specific computer, i can in no way access/login to server from any other other computer until and unless i have private key? Please cast some light over the subject as i am a bit confused now :(
you can copy the $HOME/.ssh/id_rsa file. this contains your private key and is the only one you need to move your ssh-identity.
i really recommend to create another key, though.

Send command via FTP from windows to linux

I am attempting to use a windows command (in cmd) to connect to a linux server via FTP, send a command, and have the linux box execute that command. I can get a solid connection through FTP, but I am unsure how to format the command so the linux machine will execute it. Is there a tag that should precede the code?
Thanks
ftp is just for file transmission. If you want to execute commands on the box you'll have to use ssh
If you are on windows putty would be an interactive approach for that. If you are searching for an automated solution, you could install cygwin (+ ssh client)
There are two way to communicate to your remote server via windows.
Use Cygwin which provides linux environment for windows users.
Download PuTTY for windows.
In cygwin, it provides Linux terminal environment. Use .pem key to SSH to your host
Here is the syntax
$ssh -i /cygdrive/c/path/to/the/pem/file/key.pem username#hostname
Steps to connect using PuTTY ,
1.Make sure the session tab on the left side is selected. If so, you will see fields to enter Host-name or IP address. Enter you host name here.
2.Port can be set to 22.
3.Make sure SSH radio button in the connection type.
4.On the left side, expand Connection. In the sub tree expand SSH. In this sub tree click on AUTH.
5.On the right , you will see Options controlling SSH authentication.
6.In Authentication parameters, check both the boxes.
Allow agent forwarding
Allow attempted changes of username in SSH-2
7.In the Private key file for authentication browse for the .ppk file in your computer and click on open.
Here you are.. Enjoy the awesomeness of open source.

Resources