Hi!
I recently started utilizing rclone as a replacement for scp and rsync due to the provided concurrency features and the enormous speedup rclone provides, however the switch to rclone wasn't painless. Previously I utilized SSH configuration (~/.ssh/config) to configure defaults for actively utilized SSH endpoints - provide their SSH keys, usernames, ports etc.
Unfortunately when migrating to rclone, due to the fact that rclone SFTP backend lacks an ability to read SSH config I had to resort to using the command arguments (e.g --sftp-user) or updating the rclone configuration file to duplicate most the the attributes I had already set in existing SSH configuration file.
I have looked through the previous forum discussions and GitHub issues and I haven't seen a similar feature request with regards to SSH config, thus the questions:
Are you interested in the ability to automatically read SSH config when using the SFTP backend?
Are there any reasons why such ability hasn't been implemented?
Hi @ncw,
Thanks for your feedback! I am aware of the possibility to define settings in connection strings and aliases, however that is still something what must be adjusted manually. If it was possible to provide a flag e.g --sftp-load-ssh-config it would be amazing.
I understand that currently rclone doesn't use system SSH libraries - I've taken a look at pkg/sftp and x/crypto/ssh backends being currently being utilized for SFTP backend.
The ~/.ssh/config is very powerful and implementing it all would be a huge amount of work.
I agree that implementing SSH configuration support fully would be an insane amount of work and would considerably decrease the SFTP backend's maintainability. To lower the amount of work required - what are your thoughts if support is provided only for most popular SSH configuration options, e.g:
Username;
Hostname;
IdentityFile;
Port;
Timeout;
UserKnownHostsFile?
Given that an existing, maintained implementation for parsing SSH configuration file options exists (e.g kevinburke/ssh_config) it might be easier to implement the bare minimum featureset.
Do you have any objections against introducing a new dependency on a maintained Go project which takes care of parsing the SSH configuration?
I'm asking since I might be interested in implementing the ability to read SSH configuration myself - as long as you don't have any objections in introducing such dependencies and you think that this feature would be something what would fit in with rclone featureset.