Here's a patch for wagon-ssh that uploads a file according to a set value of umask on the server side.
In our project, the project member uploads the file to the directory that directory mode is 2775. And, umask 002 is set to all the user accounts. However, wagon-ssh always up-loads the file by 644 permission when there is no filePermissions setting in the Maven's setting.xml file.
Maybe <filePermissions>umask</filePermissions>?
In addition, I think you can reuse the executeCommand function for much of this