I'd like to be able to setup a command to run on ssh login to a server, without needing to type it. Basically I'm looking for the ssh config file equivalent of:
ssh host command
so that all I need to type is:
and the command gets run.
It is also possible to insert a command in your authorized keys file. (
More specifically the redirect is for my gitolite instance. This allows simple outside access without directly exposing the gitolite host to any external access. Check the man page for more info. ( http://linux.die.net/man/8/sshd )
You could set up a bash alias.
In your .bashrc file, put:
Then you wouldn't even have to type the hostname.
Or, if you wanted to do this with multiple hosts(and multiple aliases wouldn't work), then use a small script: