force use of sh on remote server and make directory ownership check more portable