Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only the global IdentityFile is used #74

Closed
frant1 opened this issue Feb 26, 2024 · 5 comments
Closed

Only the global IdentityFile is used #74

frant1 opened this issue Feb 26, 2024 · 5 comments

Comments

@frant1
Copy link

frant1 commented Feb 26, 2024

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
Copy link

Same issue with me

@quantumsheep
Copy link
Owner

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
Copy link
Author

frant1 commented Feb 28, 2024

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
Copy link
Owner

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

@frant1
Copy link
Author

frant1 commented Feb 29, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants