Remote copy task query?


I completed the remote copy task successfully but I think I could have done it better, here’s what I did:

I used scp to copy the file to the home directory of the user on the remote server,; I then ssh’d to the remote server and copied the file from the home directory to the directory specified in the question.

I couldn’t scp the file directly to the specified directory as I kept receiving permission denied, even after chmod-ing and chown-ing the remote directory. I used the command:

scp < local file name > < remote user >@< remote server >:/remote/directory

Any thoughts on what I could have done better or if anyone wants to share their method it would be greatly appreciated.


Hi Jason

Have you created ssh keys as it will ease your task and also check the permissions of the target directory if they have write permission on it .


For this task the SSH keys were already set up so that was not an issue (copying to the users’ home directory on the remote server worked). Clearly it was a permissions issue on the remote server directory but I couldn’t get it to work. Was just curious to know from anyone else who attempted this question how they did it.


Hi Jason,

Have you tried to “request a review”. That way other engineers can view your activity and give you feedback on exactly what went wrong.

Hello, @Jazsnap
Use scp command from the jump host to the app server /tmp/ directory because we have already seen permission denied issues so we will not get permission issues in that directory. After secure copying to /tmp/ directory, move it to /home/app directory with root privileges (use sudo with cp command) because normal users cannot access or transfer data in other home directory.
Hope this will help you.