OS (for better or worse) is XP
I am having some issues, I have seen other questions but none seem to apply to me.
I have CopSSH installed and I can log in using cleartext password.
Now I want to upgrade that to SHA keys.
I use PuttyGen to get a public and private key
I then copy those into ~/.ssh and %ICW%/home/%un%/.ssh as id_rsa and id_rsa.pub.
I add the public key as follows....
Example Pubkey
---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-20121115"
AAAAB3NzaC1yc2EAAAABJQAAAIBdfRGHY4IYsUuDYzbgEy1wKXrszq5RVR4m2/gP
WJwLwiaNHpahfPeHmsG7nD7qeVNVp+sSVouApm70ZdfGnxzOHiBydtdOuco+sbqZ
irlyG9wS5yv8x9LFsGqZ34tbr8dgPXMdYnrJHJqUa3+ZMUNPXznRUzj/VTiwoS6/
jMHzkw==
---- END SSH2 PUBLIC KEY ----
Example known_host
<ServerName>,<IP>,localhost ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIBdfRGHY4IYsUuDYzbgEy1wKXrszq5RVR4m2/gPWJwLwiaNHpahfPeHmsG7nD7qeVNVp+sSVouApm70ZdfGnxzOHiBydtdOuco+sbqZirlyG9wS5yv8x9LFsGqZ34tbr8dgPXMdYnrJHJqUa3+ZMUNPXznRUzj/VTiwoS6/jMHzkw== UN#SERVER
So now I add the generated private key to putty and try to connect but I see the following...
Server refused our key
It still allows me to log in using my password.
How can I get the Private Key auth to work?
Check if Itefix FAQ https://www.itefix.no/i2/content/i-want-use-my-own-pka-key-pair-instead-one-generated-copssh can be helpful.
Related
I'm facing an error when I try to authenticate in Bitbucket using SSH private key to get my application.properties.
org.eclipse.jgit.api.errors.TransportException: https://companyuser#bitbucket.org/repositorios/cup-configuration-files: not authorized
Steps:
1) I've generated the key pair using ssh-keygen with a password
~/Development/ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/ainacio/.ssh/id_rsa):
2) I've copied the key.pub to Bitbucket
Bitbucket - User - Personal Settings - Add key
3) I've configured in bootstrap.properties the private key
spring.cloud.config.server.git.uri=https://companyuser#bitbucket.org/repositorios/cup-configuration-files
spring.cloud.config.server.git.ignoreLocalSshSettings=true
spring.cloud.config.server.git.passphrase=password
spring.cloud.config.server.git.privateKey=-----BEGIN OPENSSH PRIVATE KEY-----\n
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABD4Kfq1XF
NpUPV+q/U7OPwhAAAAEAAAAAEAAAGXAAAAB3NzaC1yc2EAAAADAQABAAABgQDuPOdeTNts
gLWlN7hLM7h+R9W76HjzrJ6pNHFVq8htKaQodmGuNFrna1y6k88FMds4XAJIv8rB2C2TyD
Y+eVKsKCfQ7xSoP/3NwOegRmvVYVUETvDJrop2Cmi4DnM6QlrtDum+VicEKjtQD7sOJ85R
WJpHkf/+CIZW8cbwdaMAjtr9LE6t+4lOg15Xfyu9zFI4YBpxb3C08/x4CS0bdiWX73Z+uT
AQWfGSbcxXleFHCDv0xCvE6/uMt2rTsnuFfLNTannEwzIYLV//0eMesQywzN+D3gxPZKeG
P1E54xXVjewsW74GJhmnI5Tm5DvsXvvQ5bkELH+isPrH9sZbncPFq9e6qjA88gk2BCLEe/
E5jdL0OKrIGFJjwpN8T/sDfq3SvuLIPvOsLlZXw0yUDgTvJdLKdwSFFB7WPKZqINXBSmKr
PUKZMm3WBB4gLccU+vD/1uardrMZ5lj0hJp7YRukWfXCFvZYLs0lnM2xnTuFsKNOfxOKDv
....
What is missing? I tried to find some tutorials but I couldn't.
PS: I'm in development environment. Accptance and production I'll use the file on .ssh server directory.
It needs to use RSA encryption algorithm ssh-keygen -m PEM -t rsa -b 4096 -C 'bitbucket_username'
I want to switch from Putty to OpenSSH for SSH connections in windows to our servers. I want to use OpenSSH only as client and I have a private key with additional passphrase.
I tried to connect to my server and OpenSSH loads the keyfile, but everytime I enter the passphrase, it seems that it isn't correct.
C:\Users\user>ssh -i D:\folder\.ssh\private_key user#host
Enter passphrase for key 'D:\folder\.ssh\private_key':
Enter passphrase for key 'D:\folder\.ssh\private_key':
Enter passphrase for key 'D:\folder\.ssh\private_key':
user#host's password:
You can see, my keyfiles are not located in the standard folder. I don't think that this is the problem, so only fyi.
What is the problem? I installed OpenSSH with the standard configuration and changed nothing.
Edit:
I also tried a different keyfile on an other server which has also a passphrase: this also doesn't work. Is that maybe a problem in configuration?
I'm sorry.
I discovered that I load a very old version. I think I get it from sourceforge and the executables are very outdated (year 2003 to 2004).
You can get a actual version from github: https://github.com/PowerShell/Win32-OpenSSH/releases/. I don't know if this is the official release. It's a bit confusing.
I usually use git on linux and I'm not familiar with sourceTree on windows ( c# project ), the interface is usefull to follow the tree, but I would like to the use commande line .
I really don't understand, I generated my ssh key with sourceTree agent and load with "Pageant", I added the public key on my bitbucket account.
And it works. I can clone/pull/push from the sourceTree interface
But using the sourceTree command line mode doesn't work
Set SSH Key to a PuTTY private key (.ppk) and set SSH Client to PuTTY / Plink
Set an environment variable GIT_SSH to the path of plink.exe, for example C:\Program Files (x86)\Atlassian\SourceTree\tools\putty\plink.exe
Of course you could have a separate, global OpenSSH key in %HOMEPATH%\.ssh\id_rsa but then you would lose the advantage of SourceTree loading the correct key automatically.
By the way, I can confirm that neither of these work:
Setting SSH Key to an OpenSSH private key and using OpenSSH as SSH Client
Setting SSH Key to a PuTTY private key and using PuTTY / Plink as SSH Client
Nothing of the above was necessary to make it work for me. The only necessary aspect to consider is that by default git (and maybe other apps) expect your ssh key in c:/users/<user>/.ssh. Mind the dot! After I renamed my ssh folder to .ssh all started working fine.
you need to generate public key from console.
like this
ssh-keygen
it will generate public key that you can add it in Bitbucket
for more info visit this Tutorial
I'm on a Windows 7 machine and have installed PuTTY. I'm trying to connect, but the authentication fails because of an incorrect password. But, the VM I'm connecting to doesn't have a password?
Here are the creds I'm trying to use:
Host: 127.0.0.1
Port: 2222
Username: vagrant
Private key: c:/users/<username>/.vagrant.d/insecure_private_key
When I open PuTTY, I put in the above credentials and click open, at which point it ask for the username and I enter 'vagrant', then it asks for the password, but there isn't a password, so I get access denied?
Not sure how to get around this?
Thanks.
The "---Begin RSA PRIVATE KEY ...." key is not of a format that PuTTY uses.
Use the program puttygen.exe (same place where the putty.exe program
is) to "Load" the private key.
Select "All Files (.)" from the filter to see the file c:/users/.../.vagrant.d/insecure_private_key
and open it. It will say that it has successfully imported foreign
key....
Then use "Save private key" option to save the loaded key
into a *.ppk file.
Then use that ppk file as the key file for "SSH |
Auth" in PuTTY
That should work.
I had experienced the opposite: using the putty proprietary .ppk format to configure the "config.ssh.private_key_path" which expects the SSH format.
You can also you the puttygen to convert from .ppk format to SSH format.
I am trying to access my heroku app from work (windows machine).
I installed cygwin on the machine and generated ssh-key as well. However, I get the below error:
C:>heroku keys:add
"C:\cygwin\home\4541450\mycoolemail#email.com"
Uploading ssh public key
C:\cygwin\home\4541450\mycoolemail#email.com
Enter your Heroku credentials. Email:
mycoolemail#email.com Password:
Uploading ssh public key
C:\cygwin\home\c54550\mycoolemail#email.com
! Contents Invalid public key /
Contents Invalid public key /
Fingerprint can 't be blank
I generated the ssh key with the command below.
ssh-keygen2 "mycoolemail#email.com" -t
rsa
ssh-keygen is not available with this cygwin.
the "C:\cygwin\home\4541450\mycoolemail#email.com" should be your public key, not the private one
Perhaps my other answer here is helpful. It's my setup for deploying to Heroku from Windows.
Do you have a passphrase on the key? Mine didn't work until I generated one with a passphrase.