When I copy a file using scp from a remote location to the /tmp/ directory in local machine, it is successful. However, when I copy another file using scp from the same machine(i.e. remote and local machines are same), I am getting the 'Permission denied' error.
scp user@host-b:/usr/U91/host-b/trace/server_console_host-b.trc /tmp
is successful.
scp user@host-a:/usr/U91/host-a/trace/server_console_host-a.trc /tmp
fails with error: /tmp/server_console_host-a.trc: Permission denied
Even normal copy fails:
cp /usr/U91/host-a/trace/server_console_host-a.trc /tmp/
cp: cannot create regular file ‘/tmp/server_console_host-a.trc’: Permission denied
I am unable to understand why scp from remote is successful while others fail.
Note: All the above commands are executed in host-a machine.