I'd suggest combining Sergiy's and Lewis's answers for maximum laziness efficiency:
First create a host entry for ssh
:
define ~/.ssh/config
file with the following contents
Host meh
HostName meh.example.com
User admin
Port 1234
IdentityFile ~/.ssh/id_rsa
Now ssh meh
works, but that could still be quite long. There is auto-completion (after ssh
[Blank]), but it's still an awful lot to type.
So let's also define an alias
:
Edit your .bashrc
in your local home directory. Add an alias like:
alias meh='ssh meh'
Now you can connect to "meh.example.com" by simply typing meh
in your terminal window.
If instead of "meh" you want to use a longer string, you can actually use [Tab] key to autocomplete.
Or if you are really lazy, just define a single character as an alias:
alias m='ssh meh'
So, if you type m and hit Enter/Return, your ssh connection will start immediately!
~/.ssh/config
? Some examples are here: nerderati.com/2011/03/17/…<protocol>://<host>:<port>/<path>
(simplified example). The syntax ssh uses to specify locations is different.ssh ssh://user@server:22/
would be invalid.