Jump to content

Secure SHell for Alfred 3: SSH (plus SFTP, mosh & ping) with autosuggest


Recommended Posts

  • 1 month later...
On 5/24/2016 at 11:02 PM, deanishe said:

The library's nowhere near done. I change the API nearly every day. The JSON output isn't even complete yet.

Go's a very nice language for workflows. It's so fast (20x faster than Python/Ruby).

 

That has nothing to do with the workflow. It just passes the system an ssh://… URL. You have to change that on your system, e.g. via iTerm > Preferences > Profiles > General > URL Schemes.

 

On 2/22/2017 at 10:07 PM, benjaminconnelly said:

This is not working for me. I have alfred 3 Build 801, Wednesday 1st February 2017, Secure SHell v0.7.1, and iterm2 Build 3.0.14. 

 

iTerm2 is handling my ssh:// and opens when i choose a connection in the workflow but nothing happens. I am taken to a blank bash prompt. 


Starting debug for 'Secure SHell'

[2017-02-22 12:35:24][STDERR: input.scriptfilter] ?
12:35:24 workflow.go:705: -------- Secure SHell/0.7.1 (AwGo/0.5.0) ---------
12:35:24 update.go:153: 73m since last check for update
12:35:24 assh.go:338: query=, username=, port=0
12:35:24 update.go:141: Latest release: 0.7.1
12:35:24 sources-config.go:94: [source/load/config] 9 host(s) in '~/.ssh/config'
12:35:24 sources-known.go:116: [known_host] Invalid hostname: 
12:35:24 sources-known.go:116: [known_host] Invalid hostname: 
12:35:24 sources-known.go:37: [source/load/known_hosts] 327 host(s) in 'known_hosts'
12:35:24 sources-history.go:76: [source/load/history] 1 host(s) in 'history'
12:35:24 sources-config.go:94: [source/load/config] 0 host(s) in '/etc/ssh'
12:35:24 sources-hosts.go:37: [source/load/hosts] 6 host(s) in '/etc/hosts'
12:35:24 sources.go:39: 3 duplicate(s) ignored
12:35:24 assh.go:555: 340 host(s) loaded in 2ms
12:35:24 feedback.go:464: Sent 340 results to Alfred
12:35:24 workflow.go:910: ---------------------- 78ms ----------------------
[2017-02-22 12:35:34][utility.debug] .
/-------- SSH ---------\
query="ssh://qa3-combined.iseatz.com"
variables=
{
    "DISABLE_CONFIG" = 0;
    "DISABLE_ETC_CONFIG" = 0;
    "DISABLE_ETC_HOSTS" = 0;
    "DISABLE_HISTORY" = 0;
    "DISABLE_KNOWN_HOSTS" = 0;
    "EXIT_ON_SUCCESS" = 1;
    "EXTERNAL_TRIGGER" = 0;
    "MOSH_CMD" = mosh;
    "SFTP_APP" = "";
    "SSH_APP" = "";
    hostname = "qa3-combined.iseatz.com";
    name = "qa3-combined.iseatz.com";
    port = 22;
    query = "";
    "shell_cmd" = 0;
    source = "known_hosts";
    url = "ssh://qa3-combined.iseatz.com";
}
\-------- SSH ---------/
[2017-02-22 12:35:34][ERROR: action.script] ?
12:35:34 workflow.go:705: -------- Secure SHell/0.7.1 (AwGo/0.5.0) ---------
12:35:34 update.go:153: 73m since last check for update
12:35:34 assh.go:256: Opening URL ssh://qa3-combined.iseatz.com
12:35:34 assh.go:264: Command: /usr/bin/open [open ssh://qa3-combined.iseatz.com]
12:35:34 workflow.go:910: ---------------------- 50ms ----------------------

 

Hi, same problem here. It was because of iTerm 2 preferences.

To set iTerm2 as default handler for ssh://, you should create another profile (named ssh for example) and set its command to $$. Then set URL Schemes to ssh.

Read iTerm2 FAQ for more information (question: How do I set iTerm2 as the handler for ssh:// links?)

Edited by Mohammad
Adding link to reference page
Link to comment
  • 3 months later...
On 5/26/2016 at 0:59 PM, deanishe said:

Added a few new features today while adding support for workflow variables to the library.
 
First up, History. If you open a connection with a username, the workflow remembers it, and will suggest it if you start typing the username again. Very handy if you need to use usernames. Use ⌥+↩ to forget a connection from the history.
 
Also, you can now open an SFTP connection, instead of an SSH one, with ⌘+↩, or ping the host with ⇧+↩

 

Thanks for a great workflow but I cannot under any circumstances remove connections from history. I have even deleted the workflow, reinstalled, history is still there... the ⌥+↩ brings up the text under the connection that delete will take place, but it doesn't work. Any ideas? Sierra 10.12.6

Link to comment
  • 2 years later...

Thank you for a very useful workflow which I've been using for a long time. I'm not sure if you want feature request sent to github or not so I'm starting here.

 

I'd like to have another alternative for the different modifier keys or change the ping cmd to do something else. I'd like to be able to connect to a host via another host instead of using a vpn service somtimes. So it would be nice to have a modifier that runs 

ssh -t proxy-host.somewhere 'ssh user-entered-host.somewhere'

 where the proxy-host is preferably an environment variable.

 

Hopefully it's understandable what I'm after. :)

 

 

 

Link to comment
1 hour ago, lari said:

I'm not sure if you want feature request sent to github

 

By preference, yes.

 

1 hour ago, lari said:

I'd like to have another alternative for the different modifier keys or change the ping cmd to do something else.

 

I doubt I'll hardcode a particular command. Perhaps I'll add a generalised system for mapping arbitrary commands to modifiers. Alfred 4 has much improved support for modifiers.

Link to comment
  • 1 month later...

Thank you for a great workflow :)

 

I know my issue is not the workflows fault, but I'm posting it here in case someone has had a similar problem!

 

I'm having some problems using sftp:// and Terminal. I can see that the workflow executes the correct command: "open -a Terminal sftp://host". But nothing happens! No new Terminal window is opened regardless of Terminal is running or not.

I know my ssh config is setup correctly as "ssh://host" works fine and I can open a sftp connection by manually executing "sftp host" in Terminal.

I have VLC installed which by default catches sftp:// URL's, so I fixed that using "SwiftDefaultApps" even though the workflow is using the -a flag. That didn't help.

 

Anyone had this issue? Google isn't much help. Most people just say that one should use ftps, but that's a completely different protocol! Hence, not helpful.

 

Setup:

Alfred-ssh: v0.8.0

macOS: 10.15.4

Terminal: 2.10

Default shell: /bin/zsh

Edited by ChristianOlsen
Link to comment
8 hours ago, ChristianOlsen said:

No new Terminal window is opened regardless of Terminal is running or not.

 

I'm pretty certain that Terminal doesn't support sftp:// URLs. It doesn't know what to do with them. Generally, I'd expect them to be associated with a FTP-style GUI application, like ForkLift or Transmit.

 

What you could do if you don’t use Mosh is to set MOSH_CMD to sftp and use ⌥↩ instead.

 

Link to comment
30 minutes ago, deanishe said:

I'm pretty certain that Terminal doesn't support sftp:// URLs. It doesn't know what to do with them. Generally, I'd expect them to be associated with a FTP-style GUI application, like ForkLift or Transmit.

 

Right, that's a good reason! Thanks you for clarifying that!

 

31 minutes ago, deanishe said:

What you could do if you don’t use Mosh is to set MOSH_CMD to sftp and use ⌥↩ instead.

 

Yeah, that's a good idea :) I'll do that 👍

 

Thanks again for a great workflow.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...