Fix SSH CLI when using custom "shell" option

Also address compatibility issue with PuTTY