“Error opening terminal xterm-color” on Mac OSX Terminal

If you are connecting to a remote server from the Mac OS X terminal and get the message "Error opening terminal: xterm-color" when doing certain operations on the remote server, then you either change your terminal’s declaration setting or add a TERM declaration to the bash profile on the server at the other end to prevent the error message from happening. There may be other ways to solve it at the server end but this post shows a quick and easy fix.