-2

I'm trying to copy few log files from the server to the local machine for further analyzing. I can log in the server with ssh and enter in the directory.

I try to copy the files with the command, scp root@logs.company.com:/srv/log/2018-05-08/payyex_prod_wallet_log /home/cherryl/Desktop

In the terminal I get output, Permission denied (publickey).. What should I do? I use a Debian 8 machine.

Arefe
  • 11,321
  • 18
  • 114
  • 168

1 Answers1

0

Sometimes the issue comes from permissions and ownership. maybe you just have the read privilige on that file, run an ls -l to know the priviliges you have on that file, if it is read only then try to modify them with a chmod command if you have the priviliges to do that.

  • Ok this may be the issue .. let me check. – Arefe May 08 '18 at 13:44
  • I provided myself the read access, but, this doesn't resolve the issue. – Arefe May 08 '18 at 14:19
  • what you need is : source directory: execute and read permission source file: read permission. target directory: execute and write permission. target file: you don't need any permission since it doesn't exit before you copy it. or write permission if the file exists. if this does not work try changing the ownership using `chown` command – Mohammed Janati Idrissi May 08 '18 at 14:35
  • it doesnt work, but I can use `tail` command to read the last 100 lines which is very handy ;-) – Arefe May 08 '18 at 14:46
  • there are multiple ways so you can read the all the file, or just a part of it like head, tail, or both combined with a pipe, cat, nano.., i still dont get why it does not work, just make sure that you've done everything correctly. – Mohammed Janati Idrissi May 08 '18 at 14:52