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

Linux Support? #5

Open
W2NJL opened this issue Sep 5, 2021 · 4 comments
Open

Linux Support? #5

W2NJL opened this issue Sep 5, 2021 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@W2NJL
Copy link

W2NJL commented Sep 5, 2021

Thank you for the hard work keeping this package alive!

I'm just wondering if there is any possibility to get this to function with Linux/Ubuntu command line in the future? OR, if there might be a way to get it to work as-is that I am not thinking of?

@jda258
Copy link
Owner

jda258 commented Sep 6, 2021

I'm glad to contribute back to the community!

This is what I do in my app currently for macOS and Linux:

processResult =  await Process.run('ssh', ["$username@$address", executeCommand]);
print('stdout: ${processResult.stdout}');

This works well for executing commands with key based auth.

@jda258 jda258 added enhancement New feature or request help wanted Extra attention is needed labels Sep 6, 2021
@W2NJL
Copy link
Author

W2NJL commented Sep 6, 2021 via email

@jda258
Copy link
Owner

jda258 commented Sep 6, 2021

If you've already generated a key in ~/.ssh/ it will work without changes. You can use the -i flag to specify a file as well. From the ssh man page:

 -i identity_file
         Selects a file from which the identity (private key) for public key authentication is read.  The default is ~/.ssh/id_dsa, ~/.ssh/id_ecdsa, ~/.ssh/id_ed25519 and
         ~/.ssh/id_rsa.  Identity files may also be specified on a per-host basis in the configuration file.  It is possible to have multiple -i options (and multiple
         identities specified in configuration files).  If no certificates have been explicitly specified by the CertificateFile directive, ssh will also try to load cer-
         tificate information from the filename obtained by appending -cert.pub to identity filenames.

@jda258
Copy link
Owner

jda258 commented Sep 6, 2021

If you're thinking about passing a string, I'd stay away from that. It's better to write a temporary file with proper permissions. There's more discussion about that here: https://stackoverflow.com/questions/12041688/specify-private-key-in-ssh-as-string

Enjoy your Labor Day weekend! I'm on the other side of the Atlantic, and we have Jeûne genevois this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants