You use the private key to connect, and you have to have your public key in the authorized_keys file on the host you are connecting to.

Looking at that log however, it doesn't look like it ever got to the key phase. It should look something like this.
ssh -vv kevin@gitlab<mailto:kevin@gitlab>
OpenSSH_8.1p1, OpenSSL 1.1.1d 10 Sep 2019
debug1: Reading configuration data /kevin/.ssh/config
debug1: /kevin/.ssh/config line 2: Applying options for gitlab
debug1: Reading configuration data /QOpenSys/etc/ssh/ssh_config
debug2: resolving "gitlab.medtronsoftware.com" port 622
debug2: ssh_connect_direct
debug1: Connecting to gitlab [192.168.2.218] port 622.
debug1: Connection established.
debug1: identity file /kevin/.ssh/kb_rsa4096_2016 type 0
debug1: identity file /kevin/.ssh/kb_rsa4096_2016-cert type -1

In yours you try to connect, and immediately got refused. I don't know much about the windows setup, so can't help on that side.


On Tue, 2020-01-14 at 14:22 +0000, Rob Berendt wrote:

I am going to try the config file.

I ran

CALL QP2TERM

touch ~/.ssh/config

chmod 600 ~/.ssh/config


EDTF '/home/ROB/.ssh/config'

Host gdl57

HostName gdl57.dekko-1

User rob

IdentityFile ~/.ssh/rob_gdisys.pub

Which begs the question: Do I use the private key or the public key?

Well, I tried both. I still get prompted for the password.


So I did some more reading and tried this:

PS C:\WINDOWS\system32> Get-Service ssh-agent


Status Name DisplayName

------ ---- -----------

Stopped ssh-agent OpenSSH Authentication Agent



PS C:\WINDOWS\system32> Start-Service ssh-agent

Start-Service : Service 'OpenSSH Authentication Agent (ssh-agent)' cannot be started due to the following error:

Cannot start service ssh-agent on computer '.'.

At line:1 char:1

+ Start-Service ssh-agent

+ ~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],

ServiceCommandException

+ FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand


PS C:\WINDOWS\system32> Get-Service ssh-agent | Select StartType


StartType

---------

Disabled



PS C:\WINDOWS\system32> Get-Service -Name ssh-agent | Set-Service -StartupType Automatic

PS C:\WINDOWS\system32> Start-Service ssh-agent

PS C:\WINDOWS\system32> Get-Service ssh-agent


Status Name DisplayName

------ ---- -----------

Running ssh-agent OpenSSH Authentication Agent


Now when I try

CALL QP2TERM

ssh gdl57

I get:

ssh: connect to host gdl57.dekko-1 port 22: Connection refused


So I asked for more detail:

ssh -vvv gdl57

OpenSSH_8.0p1, OpenSSL 1.1.1c 28 May 2019

debug1: Reading configuration data /home/ROB/.ssh/config

debug1: /home/ROB/.ssh/config line 1: Applying options for gdl57

debug1: Reading configuration data /QOpenSys/QIBM/ProdData/SC1/OpenSSH/etc/ssh_config

debug2: resolving "gdl57.dekko-1" port 22

debug2: ssh_connect_direct

debug1: Connecting to gdl57.dekko-1 [10.10.9.30] port 22.

debug1: connect to address 10.10.9.30 port 22: Connection refused

ssh: connect to host gdl57.dekko-1 port 22: Connection refused

$


cat ~/.ssh/known_hosts

<redacted>

gdl57.dekko-1,10.10.9.30 ecdsa-sha2-nistp256 <redacted>

gdl57 ecdsa-sha2-nistp256 <redacted, matches redacted information on line immediately above>

$


Bibliography:

<https://stackoverflow.com/questions/52113738/starting-ssh-agent-on-windows-10-fails-unable-to-start-ssh-agent-service-erro>

https://stackoverflow.com/questions/52113738/starting-ssh-agent-on-windows-10-fails-unable-to-start-ssh-agent-service-erro


<https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_keymanagement>

https://docs.microsoft.com/en-us/windows-server/administration/openssh/openssh_keymanagement




Rob Berendt

--

IBM Certified System Administrator - IBM i 6.1

Group Dekko

Dept 1600

Mail to: 2505 Dekko Drive

Garrett, IN 46738

Ship to: Dock 108

6928N 400E

Kendallville, IN 46755

<http://www.dekko.com>

http://www.dekko.com





[https://www.medtronsoftware.com/img/MedtronMinilogo.bmp] Kevin Bucknum
Senior Programmer Analyst
MEDDATA / MEDTRON
120 Innwood Drive
Covington LA 70433
Local: 985-893-2550
Toll Free: 877-893-2550
https://www.medtronsoftware.com



CONFIDENTIALITY NOTICE

This document and any accompanying this email transmission contain confidential information, belonging to the sender that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party and is required to destroy the information after its stated need has been fulfilled. If you are not the intended recipient, or the employee of agent responsible to deliver it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or action taken in reliance on the contents of these documents is STRICTLY PROHIBITED. If you have received this email in error, please notify the sender immediately to arrange for return or destruction of these documents.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.