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

Support connecting over a port other than 22 #143

Open
warrenbhw opened this issue Jan 19, 2023 · 1 comment
Open

Support connecting over a port other than 22 #143

warrenbhw opened this issue Jan 19, 2023 · 1 comment

Comments

@warrenbhw
Copy link

In some rare cases, I want to make a connection over a custom port.

@Druwerd
Copy link

Druwerd commented Mar 8, 2023

@warrenbhw I couldn't find it in the docs but it does support non-standard ports. This works for me:

sftp_options = {
      password: ENV['SFTP_PASSWORD'],
      port: ENV['SFTP_PORT'], # this is set to 8022
      non_interactive: true,
      append_all_supported_algorithms: true
}
sftp = Net::SFTP.start(ENV['SFTP_HOST'], ENV['SFTP_USER'], sftp_options)

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

2 participants