You can use ssh-argv0
to avoid typing ssh
.
To do this, you need to create a link to ssh-argv0
with the name of the host you want to connect, including the user if needed. Then you can execute that link, and ssh
will connect you to the host of the link name.
Example
Setup the link:
ln -s /usr/bin/ssh-argv0 ~/bin/my-server
/usr/bin/ssh-argv0
is the path of ssh-argv0
on my system, yours could be different, check with which ssh-argv0
- I have put it in
~/bin/
to be able to execute it from any directory (in OS X you may need to add ~/bin/
manually to your path on .bash_profile
)
my-server
is the name of my server, and if needed to set the user, it would be user@my-server
Execute it:
my-server
Even more
You can also combine this with mogeb answer to configure your server connection, so that you can call it with a shorter name, and avoid to include the user even if it is different than on the local system.
Host serv
HostName my-server
User my-user
Port 22
then set a link to ssh-argv0
with the name serv
, and connect to it with
serv