Dorothy Taylor wrote:Ok, I want to do it programmatically not manually. So opening a file and editing it is not an option
OK - my misunderstanding . You could use one of the Java (or whatever language you are writing in) SFTP libraries to read the remote file from machine B into your program running on A, edit it and then write it back again. This would require you to have an SFTP server running on machine B. If you have installed openssh on machine B then you automatically get an SFTP server.
My second option is still applicable - using NFS just mount the B directory on A and your program can access it directly.