I want to write a file in the Machine B under /home/test whose permissions are root:root and rwxr-xr-x.I have an account on the Machine B, named testUser. When logged to the Machine B with this user, I can use sudo to write a file under /home/test.However now I want to use ssh command on the Machine A to order testUser@MachineB to write a file under /home/test via ssh, but I got the Permission denied message when using scp to copy a file to /home/test. I want to avoid typing password so that these action can be done using a script. Is there any way to solve it?By the way, I've set ssh-key to login without password authentication. Is using setuid on a executable file on Machine B to write a file under /home/test a good way?
How to write a file a file via ssh
linux;ssh;permissions;security;scp