> You can arrow-up to go to previous commands just like in bash. But if you start a command (say, ssh) and then arrow-up you will then be cycling back through the last ways you entered that command.
Or, if you'd like to do this in Bash, and any program that uses readline: In ~/.inputrc
# Bind the up arrow to history search, instead of history step
"\e[A": history-search-backward
# And the reverse (down)
"\e[B": history-search-forward