How to copy logs over SSH?

Is there an easy way to get a log file, or copy all the text in a log file, over SSH?

I only know how to open it in nano and then I can copy but only the page I am looking at.

Maybe sftp, to just transfer the file.

Works roughly the same as ssh and use ssh for connection:

sftp user@servername
get remotefilename

To get the file
You can use ls and cd like you normally can with ssh.

1 Like

The tool you are looking for is ‘scp’ or ‘magic-wormhole’. ‘magic-wormhole’ is even better IMO (much easier to use), but I think its only available on Unix systems if that is a problem for you

2 Likes

Ok, guess I have to figure out SCP.

I think Cyberduck also has this functionality

Please use rsync instead of scp if you not have used it in the past.
Reason: Deprecating scp [LWN.net]

How to keep files in sync with rsync:

1 Like