0

I have redhat machine in this machine having some file under the /opt directory. I want to copy those file in remote machine /opt directory using rsync command. The condition is i'm using admin user which is part of wheel groups.

I have try following command to transfer the file but I getting permission denied error.

#rsync -avz -e "ssh -t" /opt/*.txt admin@ip:/opt

while I run this command i'm getting such error The error message you're encountering, mkstemp "/opt/test.txt" failed: permission denied (13), indicates that the rsync process is attempting to create a temporary file (test.txt) in a directory (/opt) where it doesn't have the necessary permissions to do so.

can anyone have idea how to process

3 Answers 3

0

did you tried using scp the syntax goes like

scp /opt/filename.txt [email protected]:/opt

here root is the root username, please use the user with sudo privileges. filename.txt should be the name of file

if the file with same name exists in remot computer, please consider renaming it before doing.

if this doesnot workout , first copy the file to temp folder and then copy it to the opt locally.

2
  • rsync -avz -e "ssh -t" /opt/*.txt admin@ip:/opt, I want to pass in this command. i don't won't to create /tmp directory, I already provide full permission on /opt directory 777 -R Commented Mar 23 at 7:35
  • if you provided 777 permission it should work , however could you try to use the roo user insted of admin.
    – biplab
    Commented Mar 23 at 17:26
0

Firstly, check that the admin user does have the necessary permissions to the /opt directory to transfer the data. Then, try again.

ls -ld /opt

Use this command to check the permissions of the /opt directory

3
  • Yes admin has full permission even i set the full permission on /opt directory Commented Mar 23 at 7:33
  • This error could be due to selinux. Try disabling the selinux or applying the right policy permissions to /opt directory. Commented Mar 26 at 12:25
  • Also try this command with sudo in the front sudo rsync -avz -e "ssh -t" /opt/*.txt admin@ip:/opt Commented Mar 26 at 12:30
-1

If we provide the full permission on /opt directory then it's worked chmod -R /opt then use the rsync -avz -e "ssh -t" /opt/*.txt admin@ip:/opt, Without permission the /opt directory not allowed to copy the file from the other users, because it's has root ownership.

That's what i learned.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .