helper method for ssh command