Using alias to start an SSH session

315 views
Skip to first unread message

Han Sooloo

unread,
Sep 21, 2012, 10:25:47 AM9/21/12
to iterm2-...@googlegroups.com
There are a few local servers for which I do not want SSH signature validation. Found the following method to do that:

ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no user@host

Now, I don't want all my profiles cluttered with the bits before user@host, so I have defined an alias as shown below and added that to /etc/bashrc (on MacOS 10.7.5).

alias ssh='/usr/bin/ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'

I can confirm that the alias works fine when I run 'ssh ro...@192.168.1.30' from a regular shell.

Now, whenever I launch a profile show setup is to use a Command, e.g., 'ssh ro...@192.168.1.30', I get the following error:

## exec failed ##
argpath=sshm error=No such file or directory

How can I use an alias to start an SSH session without the error shown above?

Thank you ...

Michael Warren

unread,
Sep 21, 2012, 1:46:22 PM9/21/12
to iterm2-...@googlegroups.com
The problem is that iTerm is looking for the command "sshm" in your
path. iTerm doesn't have access to your aliases.

You should check out the ssh_config man page. This will let you set
those options on a per-host basis without having to specify them on
the command line.

Once you have a proper ~/.ssh/config file your iTerm profile should work fine.

- Mike
Reply all
Reply to author
Forward
0 new messages