quantumsheep / sshs

Terminal user interface for SSH
MIT License
612 stars 17 forks source link

Only the global IdentityFile is used #74

Closed frant1 closed 4 months ago

frant1 commented 4 months ago

Since the v4.0.0, I'm not able to connect to my server with different private keys than the global host config.

I was first using a per server config and nothing was connecting, after I defined the "Host *" block with one private key and the servers using that private key were ok.

I'm using SSHS v4.1.1 and SSH v9.5.0.0 on Windows. (previously was on SSH v8.6 and that was the same)

It was working on SSHS v3.4

Thanks

nabihahmad commented 4 months ago

Same issue with me

quantumsheep commented 4 months ago

Hey 👋 I'm not sure to understand, you have a per-server config file or IdentityFile directive?

I'm a bit confused because sshs does not alter how ssh works.

frant1 commented 4 months ago

Hello ! I use one only ".ssh/config" file, it contains a list of arround 20 servers, here is a part of my file from the beginning to the bottom with elapsed part :

Host "XX1"
   IdentityFile  C:\Users\XXX\.ssh\FR-SaaS.pem
   HostName 172.31.4.4
   User admin
   Port 22

Host "XX2"
   IdentityFile  C:\Users\XXX\.ssh\FR-SaaS.pem
   HostName 172.31.0.4
   User admin
   Port 22
[......]
Host "YY1"
   IdentityFile  C:\Users\XXX\.ssh\Interne.pem
   HostName 172.61.1.11
   User admin
   Port 22

Host "YY2"
   IdentityFile "C:\Users\XXX\.ssh\Interne.pem"
   HostName 172.61.1.12
   User admin
   Port 22

As you can see, each Host as an IdentityFile and them aren't the same for all..

What I see on the command shown after selecting the server I want to connect to is :

Running command: ssh admin@172.31.4.4 -p 22

What I think is, the command should be ssh XX2 where XX2 is the real value of the alias name (and so that would be retrieving the config from config file naturelly OR Should be ssh -i C:\Users\XXX\.ssh\Interne.pem admin@172.31.4.4 -p 22 where "C:\Users\XXX.ssh\Interne.pem" represent the IdentityFile

quantumsheep commented 4 months ago

Ooooh you're right! I don't even know why I did it that way in v4

frant1 commented 4 months ago

I just built it myself and it's now ok ! Thanks a lot for that tool, I really like to work with it !