Support .ssh/config

Advertisement

bunam
Joined:
Posts:
2

Support .ssh/config

Hello,

As i suppose we use more Git for Windows or other tooling Ubuntu from the market, it could be cool to have a folder "ssh config" that will be automatically populated by the content of the file. Direct editing should be nice but later?

Also if I have a host named srv-ansible the URL like sftp://srv-ansible/ should go to the right server, with the good user name, using the good id file, like OpenSSH would do ;)

.ssh/config
...
Host ansible srv-ansible
 User ebt
 HostName  172.16.238.120
...
Thank you for having taken the time to read.

Reply with quote E-mail

Advertisement

abareptia
Guest

Re: support .ssh/config

I will be good have something like this setup. As we also use git and like to use config file to manage host.

Reply with quote

jpjodoin
Guest

That would be very useful for me also. My openssh config file describe all the servers I need to access on a regular basic (including jumpbox), so it would be awesome if I didn't have to worry about keeping this information in sync with my WinSCP configuration when I need to fetch/upload a file on a machine.

Reply with quote

Advertisement

shawnz
Donor
Joined:
Posts:
5

I think it would be helpful if it were supported as an import source in the "Import sites" dialog box. Of course not all OpenSSH options could be supported, but at least the HostName, Port and User settings could be processed and imported.

However this would still involve a syncing process so maybe it doesn't meet the other poster's needs. But it would be fine for me.

Reply with quote

martin
Site Admin
martin avatar

As above: How exactly do you imagine WinSCP should work with the OpenSSH config?

The config file is not a site manager (while some use like this). It's a pattern matching configuration file.

Reply with quote

shawnz
Donor

I think it would be fine to just ignore any sections that use wildcards. Or maybe options in wildcard sections could affect all imported hosts which match, and ignored otherwise.

Reply with quote

Advertisement

ppr
Joined:
Posts:
2
Location:
Poland

Parsing of wildcards would be also helpful. For me it would be ideal if it would work like this:
  • global configuration – location of ssh config file, ~/.ssh/config by default
  • option to use it as defaults when some value is not explicitly configured in WinSCP
  • matching of entered hostname to config entries, with wildcard support
  • support for things that WinSCP can easily work with, i.e. HostName, Port, User, IdentityFile, ServerAliveInterval + ServerAliveCountMax, ProxyJump

Reply with quote

ppr
Joined:
Posts:
2
Location:
Poland

Well, who in their right mind configures a dozen of identical servers by hand when they can just write web-worker-* and then use just a hostname ;)

But what I wrote is more like a layer of defaults, while the OP wanted to treat .ssh/config as a source of easily accessible configurations, more like current import functionality.

Reply with quote

Advertisement

gleynes@gmail.com
Joined:
Posts:
1
Location:
Chicago

I think that importing the ssh config file would be a very fundamental and important feature for any serious user, developers, and testers.

This comment is very good, but I don't know about the "wildcard" part. I would simply want to see an entry for each server that is in my ssh config file. I would not want to be be able to edit my ssh config from the WinSCP application to avoid unanticipated corruption.

ppr wrote:

Parsing of wildcards would be also helpful. For me it would be ideal if it would work like this:
  • global configuration – location of ssh config file, ~/.ssh/config by default
  • option to use it as defaults when some value is not explicitly configured in WinSCP
  • matching of entered hostname to config entries, with wildcard support
  • support for things that WinSCP can easily work with, i.e. HostName, Port, User, IdentityFile, ServerAliveInterval + ServerAliveCountMax, ProxyJump
I have the login information and key location for each of my servers in my ssh config, and convenient names set up for each. So, I pretty much live by this file, because it's a standard way to specify SSH connections.

Under the menu Remote I would want to see a list of connections that are imported from ~/.ssh/config (or the path specified by a system variable?).

Caveat: I just downloaded WinSCP and I don't think I've used it in the past. So, I may be off on where the menu belongs. I was surprised when this feature didn't exist and I came here to see what people have been saying. I've used FileZilla in the past, but I'm giving WinSCP a shot for various reasons. Thanks!

EDIT: It seems to have been implemented, although I didn't find documentation by searching and I can't find a way to import this file in the menus.

Reply with quote

martin
Site Admin
martin avatar

@gleynes: The OpenSSH import is implemented in upcoming WinSCP 6.0. I'm sending you an email with a development version of WinSCP to the address you have used to register on this forum.

Reply with quote

Advertisement

Gunnar
Guest

Tested 5.20 beta

Hello,

while setting up my new developer notebook I've just stumbled upon your new support for .ssh/config, which would be great for me, since I have lots of keys and connections configured there.

So I tested it via the current 5.20 beta, here are the results :-)
  • I could import the connections.
  • The connections configurations contain ~\.ssh\keyfilename, WinSCP could not read a keyfile, I changed it to %HOMEPATH%\.ssh\keyfilename in one connection, keyfile could be read.
  • WinSCP expects ppk keyfiles
So regarding my requirements it would be great if
  • keyfile references link to windows user path\.ssh\keyfilename (I wonder if this would have been the case if I installed just for the current user and not for all users?).
  • Importing could kind of "batch-create" ppk files for all keyfiles.
Best regards,
Gunnar

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Tested 5.20 beta

@Gunnar: Thanks for your tests.

Regarding the import from ~: I have fixed this:
Issue 2053 – Support importing key files that are specified using home ~ prefix from OpenSSH config file

Can you send me an email, so I can send you back a development version of WinSCP for testing? Please include a link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.

You will find my address (if you log in) in my forum profile.

Regarding the conversion to ppk: That already works. It's probably %HOMEPATH% that breaks it. And as it's not allowed in OpenSSH config file anyway, no point "fixing" it. With the original ~ and the above fix, it should work now too.

Reply with quote

Advertisement

Guest

5.20.2 beta works great but...

It would be better to import ProxyCommand as tunneling configurations as well.

For example:
Host Aliyun-Windows
  HostName 47.94.59.xxx
  User Administrator
  PasswordAuthentication no

Host GXKJ-a100
  HostName 12.2.20.xxx
  User kdyhn_gxkj
  ProxyCommand ssh -W %h:%p Aliyun-Windows

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum