You wish you were that fast to securely login via ssh right?
Also we need brew so we can install ssh-copy-id.
brew install ssh-copy-id
Now we need to install the ssh workflow for Alfred. This already enables us to connect to the hosts we want to but we still want a passwordless login, so keep on following this post.
As seen in this post from Digitalocean, it’s really easy to set up ssh keys to enable the passwordless login.
First we need to generate a ssh-key with the ssh-keygen command.
ssh-keygen -t rsa
After generating the keys with the default options you can copy the public key to the server with the ssh-copy-id command.
This command should generate a output similar to the one below.
The authenticity of host '18.104.22.168 (22.214.171.124)' can't be established. RSA key fingerprint is b1:2d:33:67:ce:35:4d:5f:f3:a8:cd:c0:c4:48:86:12. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '126.96.36.199' (RSA) to the list of known hosts. email@example.com's password: Now try logging into the machine, with "ssh 'firstname.lastname@example.org'", and check in: ~/.ssh/authorized_keys to make sure we haven't added extra keys that you weren't expecting.
Now you can try to login without a password and it should work. To integrate Alfred in this workflow, first type the hotkey to open Alfred (Alt+Space) and then type in ssh followed by user@host for the server you want to connect to.
Awesome tip thanks to bowersrob:
speed it up a bit more (after installing brew and copy-id):
vi ~/.ssh/config and add three lines for each host you regularly connect to (example below):
Host s1 (any easy to remember “name” you will use for your connection)
HostName my_server.mydomain.com (or IP Address if static – 192.168.0.100)
User admin (whatever user name you use to login to the server with)
Save and test in Alfred:
At this moment you should be at least as fast as I am. If you have any question or have run into problems while following this tutorial, please leave a comment and I will get back to you.